tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 307 forks source link

Feature Request: --no-only flag for tape CLI command #569

Closed EarthyOrange closed 2 years ago

EarthyOrange commented 2 years ago

tape cli command when invoked with --no-only flag should throw an error if there is a test built with only method.

Usage example: tape test/**/*.js --no-only

ljharb commented 2 years ago

That’s an interesting feature idea. Do any other test runners/frameworks provide it?

ljharb commented 2 years ago

I could see something similar with “no todo”, and both being specifiable via an env var, so you can have different values in CI.

EarthyOrange commented 2 years ago

@ljharb I haven't used any other test runners/frameworks to be honest. I have however seen cases where developers accidentally commit a test with only method added to it. So the hooks and CI just run that one test and declare success.

ljharb commented 2 years ago

Seems reasonable.

jocrah commented 2 years ago

hi @ljharb, tape user here. I've been going through the code recently and it has been quite a good learning experience. I would like a few clarifications to help raise a PR for this

jocrah commented 2 years ago

I could see something similar with “no todo”, and both being specifiable via an env var, so you can have different values in CI.

@ljharb, does this comment mean we'll be going with the env var approach exclusively instead of a command-line argument as stated in the issue description?

ljharb commented 2 years ago

No, both is ideal/needed. However, for each, if an env var is specified a command line flag should overwrite it.

jocrah commented 2 years ago

No, both is ideal/needed. However, for each, if an env var is specified a command line flag should overwrite it.

okay got it, thanks

ljharb commented 2 years ago

Fixed by #572.