Is there a way to import the createSpyObj
property from jasmine successfully?
After installing @types/jasmine
and jasmine-core
via npm, I attempted to import jasmine using different methods:
import jasmine from 'jasmine;
import { createSpyObj } from 'jasmine'; //results in import error in IDE
import * as jasmine from 'jasmine'; //also triggers import error in IDE
Unfortunately, all of these approaches led to an error being thrown in my WebStorm IDE when trying to access createSpyObj
.
https://i.sstatic.net/ti1MT.png
Additional Context:
In the typings file, I noticed that the createSpyObj
is located within the jasmine
namespace. While declarations like expect
and it
are global, shouldn't I be able to access createSpyObj
using jasmine.createSpyObj
?
https://i.sstatic.net/uWleN.png
Related, but not identical to:
How to import 'describe', 'expect' and 'it' into a typescript tests for IDE to not to highlight them and
Unit testing using Jasmine and TypeScript