If you'd like to use your package.json to store Jest's config, the "jest" key should be used on the top level so Jest will know how to find your settings: jest -t name-of-spec // or in watch mode jest --watch -t="TestName"
If I use the watch flag in jest however then I'm finding (quite obviously) that each time I write something to disk the tests re-fire again..
Configuring package.json Jest's configuration can be defined in the package.json file of your project or through the --config
ts-jest. non-standard environments. jest.disabledWorkspaceFolders is an array of strings with folder names. Install jest(it needs Jest 26+) and jest-watch-typeahead yarn add --dev jest jest-watch-typeahead # or with NPM npm install --save-dev jest jest-watch-typeahead Add it to your Jest config If you are using Jest <22.0.5, you can use multiple Jest configuration files and supply the paths to those files in the projects option.
jest --watch fileName.test.js As per documentation . As mentioned in other answers, test.only merely filters out other tests in the same file.So tests in other files would still run.
It is recommended to use the projects configuration option to run multiple Jest runners simultaneously. It supports all features of TypeScript including type-checking. Start you tests in watch mode. 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: vscode-jest supports multiroot feature, but if you want to turn it off for some workspace folders check out jest.disabledWorkspaceFolders configuration setting. To do that, add the --watch flag in the Jest options field. Select the Jest run/debug configuration from the list on the main toolbar and click to the right of the list. Created an PoC app npx create-react-app jest-watch-plugins with this in the root ./yourWatchPlugin.js
Optionally configure rerunning the tests automatically on changes in the related source files. Would like to implement some "hooks"/jest plugins to the tests I make with create-react-app. Read more about Babel7 + preset-typescript vs TypeScript (and ts-jest). ts-jest is a TypeScript preprocessor with source map support for Jest that lets you use Jest to test projects written in TypeScript..