setup mocha and chai
$ npm install mocha chai ts-node -g | |
$ npm install --save-dev mocha chai ts-node @types/chai @types/mocha | |
Article: https://medium.com/@FizzyInTheHall/run-typescript-mocha-tests-in-visual-studio-code-58e62a173575 |
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Mocha Tests", | |
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | |
"args": [ | |
"--require", | |
"ts-node/register", | |
"-u", | |
"tdd", | |
"--timeout", | |
"999999", | |
"--colors", | |
"--recursive", | |
"${workspaceFolder}/test/**/*.ts" | |
], | |
"internalConsoleOptions": "openOnSessionStart" | |
} | |
] | |
} |
"scripts": { | |
"test": "mocha --require ts-node/register test/**/*.ts" | |
} |
{ | |
"compilerOptions": { | |
"outDir": "tmp", | |
"target": "es5", | |
"module": "commonjs", | |
"lib": [ | |
"es2017", | |
"dom" | |
], | |
"rootDir": "src", | |
"jsx": "react", | |
"sourceMap": true, | |
"declaration": true, | |
"moduleResolution": "node", | |
"noImplicitAny": false, | |
"removeComments": true, | |
"experimentalDecorators": true, | |
"skipLibCheck": true, | |
"types": [ | |
"mocha", | |
"node" | |
], | |
}, | |
"exclude": [ | |
"node_modules", | |
"webpack.config.js", | |
"gulpfile.js", | |
"build", | |
"dist", | |
"tmp", | |
"acceptance-tests", | |
"webpack", | |
"jest", | |
] | |
} | |
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment