Monitor test execution and analyze test results in the Test Runner tab of the Run tool window. Select the Vitest run/debug configuration from the list of configurations and click in the list or on the toolbar. Otherwise, by default the debug process will use V8 Debugging Protocol. Use -inspect or -inspect-brk parameter when you are using Node.js v7 for Chrome Debugging Protocol support. Therefore make sure you have the coffeescript package installed locally as described in Install the CoffeeScript compiler. This mode requires that the register.js file, which is a part of the coffeescript package, is located inside your project. ![]() Use -require coffeescript/register to have CoffeeScript files compiled into JavaScript on the fly during run. In the Node options field, type the Node.js-specific command-line options to be passed to the Node.js executable file. For more information, refer to the Vitest official website. To do that, add the -watch flag in the Vitest options field. Learn more from the Vitest official website.Ĭonfigure rerunning tests automatically on changes in them or in the related source files. If is missing, or you want to use a custom configuration, specify the to use. This can be a specific test or suite, an entire test file, or a folder with test files.īy default, is used. 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 vitest package. Optionally specify the Node.js-specific option parameters and the environment variables to be passed to Node.js. You can also choose another configured local or remote interpreter or click and configure a new one.įor more information, refer to Configuring remote Node.js interpreters, Configuring a local Node.js interpreter, and Using Node.js on Windows Subsystem for Linux. 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: Vitest 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 Vitest from the list. In the Debug tool window, examine the suspended test and step through it. To debug a test, set a breakpoint inside it, click or in the gutter and select Debug from the list. 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 or debug a single test from the editorĬlick or in the gutter and select Run from the list. With WebStorm, you can quickly run or debug a single Vitest test right from the editor or create a run/debug configuration to run or debug some or all of your tests.įor more information about creating Vitest tests for JavaScript and TypeScript code, refer to Vitest features on the Vitest official website. Learn more from Getting Started and Configuring Vitest on the Vitest official website. In the embedded Terminal ( Alt+F12), type: ![]() Make sure you have Node.js on your computer. As soon as any changes are made to a test or to its subject, WebStorm re-runs the affected test, you do not even have to re-start the run/debug configuration. When you launch a test session in this mode, WebStorm monitors changes in your project source code. You can re-run failed tests or turn on the watch mode. You can run, debug, do snapshot testing, and measure test coverage both from the editor and via a run/debug configuration. WebStorm integrates with Vitest, a Vite-native unit test framework.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |