

If no appropriate package.json file is found, then a Jest default configuration is generated on the fly.Ĭonfigure rerunning tests automatically on changes in the related source files. The search is performed in the file system upwards from the working directory. If the field is empty, WebStorm looks for a package.json file with a jest key. Optionally specify the or file to use: select the relevant file from the list, or click and select it in the dialog that opens, or just type the path in the field. This can be a specific test or suite, an entire test file, or a folder with test files. To change this predefined setting, specify the path to the desired folder. By default, the Working directory field shows the project root folder. Specify the working directory of the application. Specify the location of the jest, react-scripts, react-script-ts, react-super-scripts, or react-awesome-scripts package.
#JEST WEBSTORM DEBUG WINDOWS#
See Configuring remote Node.js interpreters, Configuring a local Node.js interpreter, and Using Node.js on Windows Subsystem for Linux for details. You can also choose another configured local or remote interpreter or click and configure a new one. In most cases, WebStorm detects the project default interpreter and fills in the field itself. If you choose the Project alias, WebStorm will automatically use the project default interpreter from the Node interpreter field on the Node.js page. The Run/Debug Configuration: Jest dialog opens.Īlternatively, select a test file in the Project tool window and select Create from the context menu. Open the Run/Debug Configuration dialog ( Run | Edit Configurations on the main menu), click in the left-hand pane, and select Jest from the list. In the Project tool window, select the folder with the tests, and then select Run 'Tests in '.

Run all tests in a folder from the Project tool window You can also see whether a test has passed or failed right in the editor, thanks to the test status icons and in the gutter. Run a single test from the editorĬlick or in the gutter and select Run from the list.
#JEST WEBSTORM DEBUG HOW TO#
With WebStorm, you can quickly run a single Jest test right from the editor or create a run/debug configuration to execute some or all of your tests.įor information on how to create Vitest tests for JavaScript and TypeScript code, see Vitest features on the Vitest official website. Learn more from Getting Started and Configuring Jest on the Jest official website. In the embedded Terminal ( Alt+F12), type: Make sure you have Node.js on your computer. Test status is shown next to the test in the editor with an option to quickly run it or debug it. You can see the test results in a treeview and easily navigate to the test source from there. You can run and debug tests with Jest right in WebStorm. Learn more about the platform from the Jest official website. Jest is a testing platform for client-side JavaScript applications and React applications specifically.
#JEST WEBSTORM DEBUG FULL VERSION#
Instead of launching in headless mode, launch a full version of the browser using headless: false: const browser = await puppeteer. Sometimes it's useful to see what the browser is displaying.
