This repository contains 3 Projects:
Each project contains sample source code in src folder and unit tests in tests folder.
The goal is to create starter project using typescript and above testing frameworks along with debugging in VS Code and getting code coverage
The .\installCmd.sh file contains npm install commands if you want to use same npm package in your existing projects.
The .vscode\launch.json file contains settings for debugging the code in VS Code editor.
The .\Package.json file contains scripts for executing tests.
Example:
"scripts": {
"test": "mocha -r ts-node/register tests/**/*.test.ts"
}Also,.\tsconfig.json file is generated using tsc --init command
The tests are executed using
npm t(which is short for npm run test)
To get test coverage
npm run coverageIf you get error - describe is not defined, add mocha or jasmine as shown below in ts.config:
"compilerOptions": {
"types": [
"mocha"
]
}