Jest Tests
Data Access Project
Data Access Project
Initialize Jest by running these commands
npm i -D jest typescript
npm i -D ts-jest @types/jest
npx ts-jest config:initConfgure jest config
module.exports = {
roots: ["<rootDir>/."],
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/**/*.test.ts'],
coverageReporters: ['json', 'lcov'],
coverageDirectory: 'coverage',
collectCoverageFrom: [
"**/*.{js,jsx,ts}",
"!**/node_modules/**",
"!**/dist/**"
]
};Configure package.json
Configure yaml
Configure .gitignore
References:
Last updated
Was this helpful?