Skip to content

Instantly share code, notes, and snippets.

@Chuyakova
Forked from rkotze/install.md
Created November 14, 2019 16:31
Show Gist options
  • Save Chuyakova/3cfb70ae501541428ecec0fcf24729c3 to your computer and use it in GitHub Desktop.
Save Chuyakova/3cfb70ae501541428ecec0fcf24729c3 to your computer and use it in GitHub Desktop.
VS Code snippet for tests (Jest, Mocha)

Setup

  1. Under preferences -> user snippets select javascript.
  2. Copy & paste javascript.json contents

image

{
"begin test": {
"prefix": "tdd",
"body": [
"describe(\"\", function(){",
"\tit(\"\", function(){",
"\t\texpect().toEqual();",
"\t});",
"});"
],
"description": "New test file starter"
},
"it": {
"body": "it('${1:should }', () => {\n\t$0\n});",
"description": "Creates an it block",
"prefix": "it"
},
"describe": {
"body": "describe('${1:Name of the group}', () => {\n\t$0\n});",
"description": "Creates a describe block",
"prefix": "desc"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment