avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.74k stars 1.41k forks source link

Possible to execute a single test function from within a test file containing several? #1616

Closed dlumma closed 6 years ago

dlumma commented 6 years ago

Hi There,

I am wondering if I can instruct ava to execute a single test function defined in a file which contains several test functions. Is this possible and if so, how would I do this?

Thanks, -Denali

dlumma commented 6 years ago

The only way around this I can find is to use Visual Studio Code "Toggle Line Comment" after selecting all of the tests I don't currently want to run. This seems sub-optimal.

Other advances test frameworks like nose for python have support for single test execution by specifying: module name.class name:function name

Might be worth considering as a new feature.

jamestalmage commented 6 years ago

You can use the --match flag.

https://github.com/avajs/ava#running-tests-with-matching-titles

dlumma commented 6 years ago

Yes, just discovered this. Thanks! (Apologies for the obvious question.)

jgravois commented 5 years ago

new link for 2019 - https://github.com/avajs/ava/blob/master/docs/05-command-line.md#running-tests-with-matching-titles