![]() ![]() ![]() Mark the folder where the unit tests are stored as a test source folder, see Content roots. In the embedded Terminal ( Alt+F12), type:Ĭreate tests according to the instructions from the Mocha official website. Install the Chai expectation library as an efficient replacement for Node.js standard assert function. Learn more from Getting Started on the Mocha official website. Npm install -save-dev mocha to install Mocha as a development dependency. Npm install -g mocha for global installation. Npm install mocha for local installation in your project. In the embedded Terminal ( Alt+F12), type one of the following commands: Make sure the JavaScript and TypeScript and Node.js required plugins are enabled on the Settings | Plugins page, tab Installed, see Managing plugins for details.Īlthough you can use any framework, the recommended one is Mocha. Next to the test, in the editor, IntelliJ IDEA shows the status of the test with an option to quickly run or debug it. You can run Mocha tests from outside IntelliJ IDEA, examine test results arranged in a treeview, and easily navigate to the test source from there. The current page describes testing with Mocha, which is a JavaScript test framework that is especially helpful for executing asynchronous test scenarios. See the Nodeunit official website for details. With IntelliJ IDEA, you can test Node.js applications using numerous frameworks.
0 Comments
Leave a Reply. |