I have a test \'works with nested children\' within the file fix-order-test.js.
Running the below runs all the tests in the file.
jest fix-order-test
As mentioned in other answers, test.only merely filters out other tests in the same file. So tests in other files would still run.
So to run a single test, there are two approaches:
Option 1: If your test name is unique, you can enter t while in watch mode and enter the name of the test you'd like to run.
Option 2:
p while in watch mode to enter a regex for the filename you'd like to run. (Relevant commands like this are displayed when you run Jest in watch mode).it to it.only on the test you'd like to run.With either of the approaches above, Jest will only run the single test in the file you've specified.