我正在使用 mocha-phantomjs 配置成功运行我的测试用例。
现在我正在使用 Karma 启动器运行这些测试。
但我明白了这个问题Chai is not defined
.
这是我的配置文件。
module.exports = function(config) {
config.set({
client: {
mocha: {
ui: 'tdd'
}
},
basePath: '',
frameworks: ['mocha'],
files: [
'web/js/*.js',
'test/lib/*.js',
'node_modules/chai/chai.js' //added this on suggestion of the answer in stackoverflow
],
exclude: [
],
preprocessors: {
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Firefox'],
singleRun: false,
});
};
我研究过并发现了这个links https://stackoverflow.com/questions/18963281/mocha-chai-karma-suite-is-not-defined,