在Typescript中导入Chai [英] Importing Chai in Typescript
本文介绍了在Typescript中导入Chai的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在打字稿中使用chai.
I'm trying to use chai in typescript.
Chai的javascript示例显示为:
Chai's javascript example shows this as:
var should = require('chai').should();
我下载了类型定义:
tsd install chai
...已引用文件,尝试导入
...referenced the file, tried to import
/// <reference path='../typings/chai/chai.d.ts' />
import should = require('chai').should();
我得到:
error TS1005: ';' expected
...知道如何执行此操作吗?
...any idea how to do this?
推荐答案
The tests for the chai typings do the following:
import chai = require('chai');
var should = chai.should();
这对您有用吗?
这篇关于在Typescript中导入Chai的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文