我在Angularjs
上有一个项目,在bower
和jasmine
的帮助下进行了单元测试。在添加新模块(angular-treeview)之前,每件事情都运行良好。模块在浏览器中工作正常,但在测试时不在Phantomjs
中。由于某种原因,js缺失了。以下是我测试的gulp任务:
'use strict';
var gulp = require('gulp');
var wiredep = require('wiredep');
var karmaServer = require('karma').Server;
/**
* Run the unit tests
*/
gulp.task('test', ['templates'], function() {
var bowerDeps = wiredep({
directory: 'src/bower_components',
exclude: [],
dependencies: true,
devDependencies: true
});
bowerDeps.js.unshift('src/bower_components/jquery/dist/jquery.js');
var testFiles = bowerDeps.js.concat([
'src/app/app.js', // loading the module first to make Karma avoid nomod-errors
'src/{app,components}/**/*.js',
'.tmp/templates/*.js', // HTML-templates converted to JS for directives/etc
'test/unit/**/*.js'
]);
new karmaServer({
files: testFiles,
singleRun: false,
autoWatch: true,
configFile: __dirname + '/../test/karma.conf.js'
}).start();
});
angular-treeview
位于src/bower_components
,但仍然缺失。
有什么想法吗?