[英]Importing files for tests written on Mocha/Chai/TypeScript both in browser and Node.JS
[英]Importing Chai in Typescript
我正在尝试在打字稿中使用 chai。
Chai 的 javascript 示例将其显示为:
var should = require('chai').should();
我下载了类型定义:
tsd install chai
...引用了文件,尝试导入
/// <reference path='../typings/chai/chai.d.ts' />
import should = require('chai').should();
我得到:
error TS1005: ';' expected
...知道如何做到这一点吗?
import { should } from 'chai';
should();
import { expect } from 'chai';
import 'chai/register-should';
使用expect
和should
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.