Testing JavaScript
In WebStorm, you can run JavaScript test cases, methods, or entire test files against a local or remote test server using Cucumber.js, Jest, JSTestDriver, Karma, Mocha, or Protractor.
You can quickly jump from source code to the related test file with the Go to test action (Ctrl+Shift+T or ). For example, from auth.js
you can jump to auth.test.js
.
You can also see whether a test has passed or failed right in the editor, thanks to the test status icons in the left gutter.
For Mocha and Jest, you can run and debug tests and suites right from the editor: click or in the left gutter and choose Run <test_file_name> or Debug <test_file_name> from the pop-up list.
With JSTestDriver and Karma, you can also monitor how much of your code is covered with tests. WebStorm displays this statistics in a dedicated tool window and marks covered and uncovered lines visually right in the editor.
In this part:
- Creating JavaScript Unit Tests
- Testing JavaScript with Cucumber.js
- Testing JavaScript with Jest
- Testing JavaScript with JSTestDriver
- Testing JavaScript with Karma
- Testing JavaScript with Mocha
- Testing JavaScript with Protractor
- Debugging JavaScript Unit Tests