Jest: [Feature Request] - Run a specific test from the command line

Created on 25 Sep 2016  路  2Comments  路  Source: facebook/jest

I'd love the ability to append a line number to a test in the CLI and have Jest run only that test. Similar to fit or fdescribe, but not having to edit the test file.

RSpec has the functionality I'm describing: https://relishapp.com/rspec/rspec-core/v/3-5/docs/command-line/line-number-appended-to-file-path

It's smart enough to pick up a test close to where you specify (it doesn't have to be the first line of the test). For instance, if an it block takes up lines 75-81, and you append :80, the CLI runs just that test.

Most helpful comment

Is it possible to specify a line number? I see that as soooo useful in the context of an editor, being able to run whatever test is under your cursor (similar to the rspec approach above).

All 2 comments

Yes this will be in the next release as testNamePattern or -t.

Is it possible to specify a line number? I see that as soooo useful in the context of an editor, being able to run whatever test is under your cursor (similar to the rspec approach above).

Was this page helpful?
0 / 5 - 0 ratings