This week’s WebStorm 2017.2 EAP build (172.2953.12) brings support for Mocha code coverage reports, improvements in Sass and SCSS support, and more.
You can install this WebStorm 2017.2 EAP build via Toolbox App or by downloading it on this page. It can be installed side-by-side with your stable WebStorm version. A patch update from the last week EAP build is also available.
Please share your feedback and report issues on our tracker
. Thank you!
Better support for Sass and SCSS nested selectors and selectors with &
For Sass and SCSS selectors created using &, WebStorm now provides code completion in HTML files, as well as navigation to the definition (with Cmd/Ctrl-Click).
For the nested Sass and SCSS selector, you can use Navigate to the definition (Cmd/Ctrl-Click).
Code coverage for Mocha
Now you can see code coverage reports for Mocha tests right in the IDE.
To get started install nyc, the command-line interface for Istanbul:
npm install --save-dev nyc
Or install Istanbul itself with
npm install --save-dev istanbul. We recommend using
istanbul@next because it has support for ES6 and TypeScript. Make sure that Mocha is also installed and properly set up.
Now select the set of tests you’d like to run – that could a folder with test files, a test file, a suite or a specific test – then create a new Mocha run/debug configuration via Edit Configurations dialog, save it and hit the Run with coverage icon.
You can also use the test icons in the editor to quickly run a specific suite or a test with coverage.
The coverage report will open next to the editor, showing how many files were covered with tests and the percentage of covered lines in them. From the report you can jump to the file and see what lines were covered – marked green – and what lines were not covered – marked red.