Using Jest?
In case anyone gets here AND you’re using Jest to test your Angular app (hopefully we’re a growing minority), you will run into this error if you are not emitting decorators ("emitDecoratorMetadata":true
). You’ll need to update your tsconfig.spec.json
file so it looks like:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": "../../out-tsc/spec",
"types": [
"jest",
"node"
]
},
"files": [
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}