我已经使用 npm 安装了 node-qunit,这似乎可以正常工作。
以下脚本什么都不做……没有错误,没有 qunit 输出(甚至没有失败的测试用例):
var testrunner = require('qunit');
testrunner.run({
code: '/Users/macuser/Documents/test-input.js',
tests: '/Users/macuser/Documents/test-cases.js'
}, function(report) {
console.log(report);
});