Jest: Question / feature request: running a specific test

Created on 22 Aug 2016  路  8Comments  路  Source: facebook/jest

Is there a way to run a specific test in a specific file, e.g.

jest Foo:142

Meaning run the first file matching Foo and specifically the test located at line 142?

Most helpful comment

we have in the docs in under the jest global environment :)
i was also thinking about bringing back the old API it.only, test.only, describe.only, just to reduce the number of globals

All 8 comments

you can't do it from CLI, but you can run the test matching Foo by doing jest Foo and focusing your specific test by using fit instead of it

Nice, that definitely satisfies the need. Thanks! I see that's a Jasmine feature, might be worth a mention in the docs somewhere...

we have in the docs in under the jest global environment :)
i was also thinking about bringing back the old API it.only, test.only, describe.only, just to reduce the number of globals

We definitely need ftest or test.only.

@dmitriiabramov

Could you reopen this issue? Migrating from AVA to Jest, and the test.only syntax is the only thing I miss.

test.only will be added in 15.2. For now use fit.

@cpojer

Thanks! I'll live for now 馃槄

@AriaFallah they're not documented yet, but you can see the full list of new globals in https://github.com/facebook/jest/pull/1632

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nsand picture nsand  路  3Comments

Antho2407 picture Antho2407  路  3Comments

jardakotesovec picture jardakotesovec  路  3Comments

Secretmapper picture Secretmapper  路  3Comments

ianp picture ianp  路  3Comments