1
如何从茉莉花进口createSpyObj
财产?如何从茉莉花中为“手稿”中的测试导入“createSpyObj”?
我已经通过npm安装@types/jasmine
和jasmine-core
。
我已经试过进口茉莉为:
import jasmine from 'jasmine;
import { createSpyObj } from 'jasmine'; //triggers import error in IDE
import * as jasmine from 'jasmine'; //triggers import error in IDE
这些都不能让我访问createSpyObj
没有在我的WebStorm IDE抛出一个错误。
更多信息:
我看到在分型文件createSpyObj
命名空间声明。它嵌套在jasmine
名称空间中。这与expect
,it
不同,它们是全局声明,但我不能用jasmine.createSpyObj
访问它吗?
相关,而不是重复的
How to import 'describe', 'expect' and 'it' into a typescript tests for IDE to not to highlight them和
Unit testing using Jasmine and TypeScript