Skip to content

browserConsoleLogOptions does not filter console by level #2228

@jambonrose

Description

@jambonrose

Expected behavior

I expect that if browserConsoleLogOptions.level === 'error', then any instance of console.log, console.debug or console.warn will not appear in my terminal.

Actual behavior

Instances of console.debug are still shown in my console, despite the following in my Karma configuration:

    browserConsoleLogOptions: {
      level: 'error',
      format: '%b %T: %m',
      terminal: true
    },

Specifically, console.debug('hello there!'); results in DEBUG: 'hello there!' being printed when I run tests.

Note that switching browserConsoleLogOptions.terminal to false correctly silences all console output.

Enviroment Details

Karma 1.1.0 with Webpack 2 through Babel 6 on macOS 10.11.5 with npm 3.8.8 and node v5.11.0. Please see package.json for full requirements.

Steps to reproduce the behaviour

  1. Clone the example repo found at https://github.com/jambonsw/webpack2-karma-logging-error-mve
  2. Install the packages with npm install
  3. Run tests with npm test

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions