Created
August 2, 2018 19:22
-
-
Save schuchard/7c8ac28fe4eaeebeea2f60e9fe3cb5b2 to your computer and use it in GitHub Desktop.
snippets for Typescript development & testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Import module": { | |
"prefix": "im", | |
"body": "import { $2 } from '$1';", | |
"description": "Import module from location" | |
}, | |
"Print to console": { | |
"prefix": "con", | |
"body": "console.log('${label} -> ', ${label});", | |
"description": "Log output to console" | |
}, | |
"Track time": { | |
"prefix": "time", | |
"body": [ | |
"console.time('${label}');", | |
"console.log('${label} -> ', ${label});", | |
"console.timeEnd(\"${label}');" | |
], | |
"description": "Track the time of a function" | |
}, | |
// Testing | |
"Describe block": { | |
"prefix": "des", | |
"body": [ | |
"describe('$1', () => {", | |
"$2", | |
"});" | |
], | |
"description": "Describe testing block" | |
}, | |
"It block": { | |
"prefix": "it", | |
"body": [ | |
"it('should $1', () => {", | |
"$2", | |
"});" | |
], | |
"description": "Create It block" | |
}, | |
"BeforeEach": { | |
"prefix": "bef", | |
"body": [ | |
"beforeEach(() => {", | |
"$1", | |
"});" | |
], | |
"description": "Create beforeEach body" | |
}, | |
"Test expectation": { | |
"prefix": "ex", | |
"body": [ | |
"expect($1).toEqual($2);" | |
], | |
"description": "Create test expectation body" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment