【发布时间】:2017-06-24 23:12:25
【问题描述】:
我已经安装了 Mocha 和 Chai。
在我的单元测试中:
import {expect, should} from "chai";
describe("array", function () {
it("has length of 1", function (done) {
var arr = ["B"];
expect(arr).have.lengthOf(1);
arr.should.have.lengthOf(1);
});
});
expect 按预期工作,但 should 未定义。
为什么?
【问题讨论】:
标签: javascript node.js unit-testing mocha.js chai