0

I'm developing web an app using AngularJS + TypeScript, and Karma + Jasmine for testing purposes.

The problem is that WebStorm continues pestering me with the following error, despite the fact that all of my tests compile well:

Unresolved function or method inject()

enter image description here

I've added angular-mocks typings:

enter image description here

and provided angular-mocks JavaScript library for IDE:

enter image description here

But the problem still exists. I know that as a workaround, one can declare corresponding variable, but honestly I don't really think that this is a good approach.

1 Answer 1

2

Works fine for me using typings (npm i @types/angular-mocks):

enter image description here

Please try invalidating caches

Sign up to request clarification or add additional context in comments.

2 Comments

I've reinstall angular-mocks type, using npm i @types/angular-mocks command as was proposed and invalidated caches, but with no success.
sorry, didn't read your post carefully enough^( This works for javascript, but not for typescript. Please follow youtrack.jetbrains.com/issue/WEB-26723 for updates

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.