Last active
December 22, 2018 06:38
-
-
Save Zerg00s/ad8b05a3f54d28d40ba4de3a5d336d88 to your computer and use it in GitHub Desktop.
setup mocha and chai
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
$ 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 |
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
{ | |
// 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" | |
} | |
] | |
} |
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
"scripts": { | |
"test": "mocha --require ts-node/register test/**/*.ts" | |
} |
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
{ | |
"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", | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Article https://medium.com/@FizzyInTheHall/run-typescript-mocha-tests-in-visual-studio-code-58e62a173575