ts-jest configuration: https://kulshekhar.github.io/ts-jest/user/config/
cheat sheet: https://github.com/sapegin/jest-cheat-sheet#basic-matchers
https://github.com/kulshekhar/ts-jest
Follow steps in "Getting Started"
By default in .test.ts
test("jest configuration", ()=>{
expect(1+1).toBe(2);
})
test("async style test", (done)=>{
expect(1+1).toBe(2);
done();
})
No need to import test functions: in global space through definitions
Definitions in @types/jest, if "types" "typeRoots" is used, must be included
Structure - see cheat sheet
May want to exclude tests from lint in tslint.json
"linterOptions": {
"exclude": [
"**/*.test.ts"
]
},
https://jestjs.io/docs/en/troubleshooting#debugging-in-vs-code
Check "to automatically...", put that code in "launch.json"
https://codewithhugo.com/jest-exclude-coverage/
/* istanbul ignore file */
/* istanbul ignore next */
/* istanbul ignore else */