Skip to content

Instantly share code, notes, and snippets.

@Zerg00s
Last active December 22, 2018 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zerg00s/ad8b05a3f54d28d40ba4de3a5d336d88 to your computer and use it in GitHub Desktop.
Save Zerg00s/ad8b05a3f54d28d40ba4de3a5d336d88 to your computer and use it in GitHub Desktop.
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",
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment