Skip to content

No error is returned when using a browser that is not installed. #2403

@hmil

Description

@hmil

Expected behaviour

Given that the target browser is PhantomJS
and the plugin package for PhantomJS is not installed.
When the following code runs:

  new karma.Server({
    configFile: __dirname + '/karma.conf.js',
    singleRun: true
  }, function(status) {
    console.log(status);
  }).start();

Then the console should print an error and an error status != 0 like this:

12 10 2016 17:25:43.747:ERROR [launcher]: Cannot load browser "PhantomJS": it is not registered! Perhaps you are missing some plugin?
12 10 2016 17:25:43.748:ERROR [karma]: Found 1 load error
{something that is not 0}

Actual behaviour

The console shows a status 0:

12 10 2016 17:25:43.747:ERROR [launcher]: Cannot load browser "PhantomJS": it is not registered! Perhaps you are missing some plugin?
12 10 2016 17:25:43.748:ERROR [karma]: Found 1 load error
0

Environment Details

  • Karma version (output of karma --version): 1.3.0
  • Relevant part of your karma.config.js file
{
    browsers: ['PhantomJS'],
}

Steps to reproduce the behaviour

See above.

Additional notes

This breaks the recommended usage shown in gulp-karma as the job will exit with status 0 and pass CI checks although no tests actually ran!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions