karma: v1.1.0 and v1.2.0 do not run any tests

Expected behavior

Karma runs my tests

Actual behavior

I see the following output:

29 06 2016 15:12:22.909:INFO [karma]: Karma v1.1.0 server started at http://localhost:9876/
29 06 2016 15:12:22.913:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
29 06 2016 15:12:22.927:INFO [launcher]: Starting browser PhantomJS
29 06 2016 15:12:25.739:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Connected on socket /#bDpfsp5qhtjVLGXQAAAA with id 3610229

START:
(node:20928) Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
(node:20928) Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
(node:20928) Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
(node:20928) Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
(node:20928) Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
(node:20928) Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
(node:20928) Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  ReferenceError: Can't find variable: jasmineRequire
  at G:/Cloud/Apps/REMProcessPilot/angular2-webpack/Diamant.Cloud.Apps.REMProcessPilot/node_modules/karma-jasmine-html-reporter/src/lib/html.jasmine.reporter.js:24
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  ReferenceError: Can't find variable: jasmineRequire
  at G:/Cloud/Apps/REMProcessPilot/angular2-webpack/Diamant.Cloud.Apps.REMProcessPilot/node_modules/karma-jasmine-html-reporter/src/lib/html.jasmine.reporter.js:24
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  ReferenceError: Can't find variable: jasmineRequire
  at G:/Cloud/Apps/REMProcessPilot/angular2-webpack/Diamant.Cloud.Apps.REMProcessPilot/node_modules/karma-jasmine-html-reporter/src/lib/html.jasmine.reporter.js:24

Finished in 0.151 secs / 0 secs

SUMMARY:
√ 0 tests completed

Enviroment Details

  • Karma Version 1.1.0
  • Windows 8.1

Karma.conf.js:

const webpackConfig = require('./webpack.tests.config.js');

module.exports = function (config) {
    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '..',

        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            { pattern: 'config/tests.js', included: true, watched: false },
            { pattern: 'static/images/**/*', included: false, watched: false },
            { pattern: 'static/data/**/*', included: false, watched: false }
        ],

        // list of files to exclude
        exclude: [
        ],
        proxies: {
            '/images': '/base/static/images',
            '/data': '/base/static/data'
        },

        webpack: webpackConfig,

        webpackMiddleware: {
            noInfo: true,
            stats: {
                colors: true
            }
        },

        plugins: [
            'karma-webpack',
            'karma-jasmine',
            'karma-phantomjs-launcher',
            'karma-chrome-launcher',
            'karma-verbose-reporter',
            'karma-clear-screen-reporter',
            'karma-jasmine-html-reporter',
            'karma-sourcemap-loader',
            'karma-mocha-reporter',
            'karma-trx-reporter'
        ],

        preprocessors: {
            'config/tests.js': ['webpack', 'sourcemap'],
        },

        verboseReporter: {
            color: 'full',
        },

        trxReporter: { outputFile: 'test-results.trx' },

        mochaReporter: {
            // output: 'autowatch'

        },


        // test results reporter to use
        // possible values: 'progress', 'verbose', 'kjhtml', 'mocha', 'trx'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: ['kjhtml', 'mocha', 'trx'],

        // web server port
        port: 9876,

        webpackServer: { noInfo: true },

        // enable / disable colors in the output (reporters and logs)
        colors: true,

        // level of logging
        // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
        logLevel: config.LOG_INFO,

        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: true,

        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        browsers: ['PhantomJS'],
        //browsers: ['Chrome'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false,

        // Concurrency level
        // how many browser should be started simultaneous
        concurrency: Infinity
    });
}

Steps to reproduce the behaviour

  1. Upgrade karma to 1.1.0
  2. karma start karma.conf.js

Karma works as expected with 1.0.0

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

The problem is NOT fixed. Please reopen this issue.

All you fixed is that the output no longer contains the promise warnings, which is not what this bug report was about. The problem is that karma is not running any tests!

START:
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  ReferenceError: Can't find variable: jasmine
  at G:/Cloud/Apps/REMProcessPilot/angular2-webpack/Diamant.Cloud.Apps.REMProcessPilot/node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:6
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  ReferenceError: Can't find variable: jasmine
  at G:/Cloud/Apps/REMProcessPilot/angular2-webpack/Diamant.Cloud.Apps.REMProcessPilot/node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:6
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  ReferenceError: Can't find variable: jasmine
  at G:/Cloud/Apps/REMProcessPilot/angular2-webpack/Diamant.Cloud.Apps.REMProcessPilot/node_modules/karma-jasmine-html-reporter/src/lib/adapter.js:6
12 08 2016 07:22:49.004:WARN [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Disconnected (1 times)
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  Disconnectedundefined
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  Disconnectedundefined
PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  Disconnectedundefined
12 08 2016 07:22:49.008:ERROR [launcher]: PhantomJS crashed.


Finished in 0.142 secs / 0 secs

SUMMARY:
√ 0 tests completed

@oocx can you please provide a repo that reproduces this error, all jasmine tests I have are running fine on the latest version.