Alo*_*lon 3 javascript unit-testing mocha.js node.js chai
我已经安装了 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);
});
});
Run Code Online (Sandbox Code Playgroud)
expect按预期工作,但should未定义。
为什么?
| 归档时间: |
|
| 查看次数: |
1682 次 |
| 最近记录: |