1

我有一个项目,在和 的帮助下,Angularjs单元测试涵盖了该项目。在我添加一个新模块(angular-treeview)之前,一切都很好。模块在浏览器中工作正常,但在测试时不能。由于某种原因缺少js。这是我的测试任务: bowerjasminePhantomjs

'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-treeviewsrc/bower_components但仍然失踪​​。

有任何想法吗?

4

0 回答 0