TDD Describe
{
"Jest Describe": {
"prefix": ["desc", "jdesc"],
"body": [
"describe('', () => {",
" test('Should ', () => {});",
"});",
"",
]
}
}
TDD Test
{
"Jest Test": {
"prefix": ["test", "it"],
"body": [
"test('Should ', () => {});"
]
}
}
TDD With SuperTest and Express
{
"Jest Test With SuperTest And Express": {
"prefix": [
"spt",
"super"
],
"body": [
"import { Server } from 'http';",
"import request from 'supertest';",
"import app from 'path/to/app';",
"",
"describe('', () => {",
" let server: Server;",
" let supertest: request.SuperAgentTest;",
" beforeAll(async () => {",
" server = app.listen(4001);",
" supertest = request.agent(server);",
" });",
"",
" afterAll(async () => {",
" if (server) {",
" server.close();",
" }",
" });",
"",
" test('Should ', () => {});",
"});",
""
]
}
}