Reputation: 57036
I've recently switched to Jest for unit testing
Previously I was doing this:
ng test --configuration=unit-tests
But I am not sure how to run my Jest tests with an Angular configuration, I want something like this:
jest --configuration=unit-tests
How do I run my Jest tests with a specified Angular configuration?
Upvotes: 0
Views: 732
Reputation: 2265
"jest": {
"preset": "jest-preset-angular",
"setupFilesAfterEnv": [
"<rootDir>/setupJest.ts"
]
}
modify the test script to use Jest instead of ng test.
run npm test
Upvotes: 1
Reputation: 647
In angular.json file specify jest runner for test architect:
"test": {
"builder": "@angular-builders/jest:run",
"options": {}
},
I assume that you have installed it, when switched to jest
Upvotes: 1