krishnakumarp
krishnakumarp

Reputation: 9295

Tests fail after karma upgrade from 0.12 to 0.13

My karma scripts stops working when I upgrade the following dependencies

 grunt-karma     0.11.0  →      0.12.0
 karma-jasmine    0.3.5  →       0.3.6
 karma          0.12.35  →      0.13.9

The verbose log output is as below.

DEBUG [plugin]: Loading karma-* from C:\project\node_modules
DEBUG [plugin]: Loading plugin C:\project\node_modules/karma-chrome-launcher.
DEBUG [plugin]: Loading plugin C:\project\node_modules/karma-html2js-preprocessor.
DEBUG [plugin]: Loading plugin C:\project\node_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin C:\project\node_modules/karma-phantomjs-launcher.
DEBUG [plugin]: Loading plugin C:\project\node_modules/karma-requirejs.
DEBUG [plugin]: Loading plugin C:\project\node_modules/karma-script-launcher.

Warning: Cannot read property 'mtime' of undefined Use --force to continue.

Aborted due to warnings.

My karma.conf.js is as below.

module.exports = function (config) {
    config.set({
        basePath: './',

        frameworks: ['jasmine'],

        files: [
            // bower:js
            '../src/bower_components/modernizr/modernizr.js',
            // Other bower dependencies
            '../src/bower_components/angular-mocks/angular-mocks.js',
            // endbower
            '../src/scripts/app/app.js',
            '../src/scripts/app/**/*.js',
            '../src/scripts/components/**/*.{js,html}',
            './**/!(karma.conf).js'
        ],

        exclude: [],
        port: 9876,
        logLevel: config.LOG_DEBUG,
        autoWatch: false,
        browsers: ['PhantomJS'],
        singleRun: false
    });
};

What could be the reason? Thanks.

Upvotes: 2

Views: 334

Answers (1)

krishnakumarp
krishnakumarp

Reputation: 9295

My problem was solved using the suggestion given on this karma issue - https://github.com/karma-runner/karma/issues/1532.

So changing *.{js,html} to *.+(js|html) fixed this issue.

Upvotes: 2

Related Questions