[英]Importing Chai in Typescript
I'm trying to use chai in typescript.我正在尝试在打字稿中使用 chai。
Chai's javascript example shows this as: Chai 的 javascript 示例将其显示为:
var should = require('chai').should();
I downloaded the type definition:我下载了类型定义:
tsd install chai
...referenced the file, tried to import ...引用了文件,尝试导入
/// <reference path='../typings/chai/chai.d.ts' />
import should = require('chai').should();
I get:我得到:
error TS1005: ';' expected
...any idea how to do this? ...知道如何做到这一点吗?
import { should } from 'chai';
should();
import { expect } from 'chai';
import 'chai/register-should';
to use both expect
and should
使用expect
和should
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.