Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webstorm and VisualCode complaining about the new Matchers #22

Open
gpeel opened this issue Jul 19, 2022 · 3 comments
Open

Webstorm and VisualCode complaining about the new Matchers #22

gpeel opened this issue Jul 19, 2022 · 3 comments

Comments

@gpeel
Copy link

gpeel commented Jul 19, 2022

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.

image
image

the code is availlable at URL

@JamieMason
Copy link
Owner

JamieMason commented Jul 29, 2022

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?

@gpeel
Copy link
Author

gpeel commented Jul 31, 2022

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

@gpeel
Copy link
Author

gpeel commented Aug 11, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants