我很难用摩卡/柴
下面是我目前正在尝试执行的代码(比如chai docs)
我尝试过用不同的方式从“run”命令调用该文件(正如我在堆栈溢出的其他帖子中看到的那样),但在我的情况下,它们都没有工作。
提前谢谢你,
保罗
var expect = require('chai').expect,
foo = 'bar',
beverages = { tea: ['chai', 'matcha', 'oolong'] };
expect(foo).to.be.a('string');
expect(foo).to.equal('bar');
expect(foo).to.have.lengthOf(3);
expect(beverages).to.have.property('tea').with.lengthOf(3);package.json
"scripts": {
"dev": "nodemon index.js",
"test": "mocha ./test/app.spec.js"
},
[...]
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^8.1.3"
}发布于 2020-11-24 08:47:33
这个问题已经解决了,从摩卡项目开始,然后定义
"test": "mocha"保罗
https://stackoverflow.com/questions/64878312
复制相似问题