我正在尝试让 Karma 使用 Jamine 的ajax.js
https://github.com/IDCubed/karma-jasmine-ajax
我的业力配置有:
module.exports = function(config) {
config.set({
...
frameworks: ['jasmine-ajax', 'jasmine'],
});
};
我的 package.json 有:
"devDependencies": {
"bower": "^1.4.1",
"del": "^1.1.1",
"gulp": "^3.8.11",
"gulp-concat": "^2.5.2",
"gulp-karma": "0.0.4",
"jasmine-ajax": "^3.1.0",
"jasmine-core": "^2.2.0",
"karma": "0.12.31",
"karma-chrome-launcher": "0.1.7",
"karma-cli": "0.0.4",
"karma-jasmine": "0.3.5",
"karma-jasmine-ajax": "^0.1.12",
"karma-junit-reporter": "^0.2.2",
"yargs": "^3.7.1"
}
我的规格是这样的:
describe("mocking ajax", function() {
describe("suite wide usage", function() {
beforeEach(function() {
jasmine.Ajax.install();
});
afterEach(function() {
jasmine.Ajax.uninstall();
});
it('does something', function() {
});
});
});
但我有这个错误:
/node_modules/karma/node_modules/di/lib/injector.js:9
throw error('No provider for "' + name + '"!');
^
Error: No provider for "framework:jasmine-ajax"! (Resolving: framework:jasmine-ajax)
我显然缺少一些插件或其他东西......但是什么?