This extension contains code snippets for common test driven development (TDD) functions that will speed up your testing and make it that much more enjoyable.
Installation
To install any extension, launch Command Pallette (Ctrl + Shift + P or Cmd + Shift + P) and type in Extensions. You will be shown 2 sections, 1) extensions already installed, 2) new extensions to install.
Features
This code snippet extension brings many common test cases to your fingertips:
![feature X](images/feature-x.png)
Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
Supported languages
JavaScript (.js) [ES6+]
TypeScript (.ts) [ES6+]
ReactJS (.js)
Supported frameworks/libraries
Jest/Enzyme
Jasmine
Sinon
Snippets
Here is the list of all snippets and how to trigger them. The → at the end means you need to press the TAB key.
Common Triggers
Effect
des→
'describe, set up test suite'
bfa→
'beforeAll, set up initial values for all test cases'
bfe→
'beforeEach, set up initial values for each test case'
Basic it() Triggers
Effect
itb→
'it() be a result'
ieq→
'it() equal a result'
ide→
'it() existence of a result'
iud→
'it() non-existence of a result'
ima→
'it() match a result'
itr→
'it() truthiness of a result'
ifa→
'it() falsiness of a result'
ict→
'it() contain a result'
igt→
'it() greater than a result'
igte→
'it() greater than or equal to a result'
ilt→
'it() less than a result'
ilte→
'it() less than or equal to a result'
ict→
'it() close to a result'
inn→
'it() not a number'
inu→
'it() is null'
ini→
'it() negative infinity of a result'
ipi→
'it() positive infinity of a result'
iex→
'it() exception of a result'
iee→
'it() exception of a result with an error'
iem→
'it() exception of a result with a matching'
ihc→
'it() result to have class'
Basic test() Triggers
Effect
ttb→
'test() be a result'
teq→
'test() equal a result'
tde→
'test() existence of a result'
tud→
'test() non-existence of a result'
tma→
'test() match a result'
ttr→
'test() truthiness of a result'
tfa→
'test() falsiness of a result'
tct→
'test() contain a result'
tgt→
'test() greater than a result'
tgte→
'test() greater than or equal to a result'
tlt→
'test() less than a result'
tlte→
'test() less than or equal to a result'
tct→
'test() close to a result'
tnn→
'test() not a number'
tnu→
'test() is null'
tni→
'test() negative infinity of a result'
tpu→
'test() positive infinity of a result'
tex→
'test() exception of a result'
tee→
'test() exception of a result with an error'
tem→
'test() exception of a result with a matching'
thc→
'test() result to have class'
Complex it() Triggers
Effect
isp→
'it() spy to have been called'
isp1→
'it() sinon spy to have been called once'
isp2→
'it() sinon spy to have been called twice'
isp3→
'it() sinon spy to have been called thrice (three times)'
isto→
'it() sinon stub to have been called'
imoc→
'it() sinon mock to have been called'
Complex test() Triggers
Effect
tsp→
'test() spy to have been called'
tsp1→
'test() sinon spy to have been called once'
tsp2→
'test() sinon spy to have been called twice'
tsp3→
'test() sinon spy to have been called thrice (three times)'