- Create a folder test at the same level as the src folder
- Populate the test folder. For each production file, create a separate test file.
- Mark the folder where the tests are stored as test folder.
-
Open the Run/Debug Configuration dialog box by doing one of the following:
- On the main menu, choose .
- Press RunConfigurationRunConfiguration and choose Edit Configuration on the context menu.
-
Click the Add button
on the toolbar and select the Nodeunit configuration type.
-
In the dialog box that opens, specify the following:
- The name to identify the configuration.
-
The path to the NodeJS installation to use.
If you have appointed one of the installations as default, the field displays the path to its executable file.
- The working directory. This can be the project root folder or the parent directory for the test folder.
-
The scope of tests to run.
- To have PhpStorm run all the test files in a folder, choose All JavaScript test files in the directory from the Run drop-down list. In the Directory text box, type the path to the test folder relative to the working directory.
- To have a specific test executed, choose JavaScript test file from the Run drop-down list. In the JavaScript test file text box, type the path to the file relative to the working directory.
- Apply the changes and close the dialog box.

framework.