Unit Testing JavaScript
PhpStorm provides facilities for running JavaScript unit tests against a local or remote test server. You can run test cases, methods, or entire test files.
To create and run unit tests in JavaScript, perform these general steps
- Enable JavaScript unit testing support.
- Write the unit tests.
- To have PhpStorm recognize the unit tests and detect the corresponding production source code, mark the folder where the unit tests are stored as test folder.
- If applicable, write configuration files that define which test and corresponding production files should be loaded into the browser and in which order.
- Start the test server and capture a browser.
- Launch unit tests and monitor test results in the Run tool window.
The topics in this part provide guidelines in JavaScript-specific unit testing procedures.
- Enabling JavaScript Unit Testing Support
- Creating JavaScript Unit Tests
- Running JavaScript Unit Tests
- Monitoring Code Coverage for JavaScript
- Debugging JavaScript Unit Tests
For general information on testing in PhpStorm, see the section Testing.
See Also
Concepts:
Last modified: 12 July 2016