Open gpeel opened 2 years ago
Hi @gpeel, my answer is a little broad and vague just because I don't have much information to work with so far. How does your setup compare to the instructions here? If it matches, what versions are you using?
Hi well I followed exactly those instructions And also in the last line of the the preceding post, I give access to a full code in github to check what I did. Here it is: https://github.com/gpeel/test-adding-jasmine-matchers
So my conclusion so far is that there seems to be something missing from those insctructions. since starting afresh with a new project does not work. I tries to change a few things but never was able to make it work
I found a way to solve the problem by adding those lines in tsconfig.json
"typeRoots": [
"./node_modules/@types",
"./node_modules/jasmine-expect/dist"
]
Or another solution, to add
/// <reference types="jasmine" />
at the top of the test file. Then the IDE find the definitions
But looking at the file ./node_modules/jasmine-expect/package.json the types property is already set to dist/index.d.ts So it should work automatically, but it doesn't.
Any idea why ?
Starting with a fresh new Angular 14 project and following instruction to install karma-jasmine-matchers enable correct execution of tests but the 2 IDEs complains about the added matchers.
the code is availlable at URL