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