ES6 Mocha Snippets is a great Visual Studio Code extension to help speed up writing your unit tests. Given how important unit testing is, anything that speeds it up good in my opinion.
Installation
Installation is super straightforward through either the extensions bar or Visual Studio Code quick open command.
Browsing and installing extensions is easy in Visual Studio Code. Just bring up the extensions bar then search for “ES6 Mocha Snippets” and hit install.
Alternatively if you already know what extension you want to install, use the quick open shortcut (⌘+P for Mac, Ctrl+P for Windows and Linux) then enter “ext install {name of snippet}”.
So for this extension it would be;
ext install es6-mocha-snippets
Usage
This extension provides a range of snippets for ES6 Mocha tests, such as for “describe”, “it” and “before”
To use, start typing the desired snippet, use the arrow keys to select the correct snippet, then tab or enter to complete the snippet.
A great extension to help speed up writing those all important tests! Check out the market place page for it here.
If you need a refresher, here is my introduction to Javascript unit testing using Mocha.