Skip to content

Karma with Webpack 2 raises errors about Promises #2227

@jambonrose

Description

@jambonrose

Expected behavior

Karma+Webpack2 runs without raising errors about Promises (especially when none of the tests or code use Promises).

Actual behavior

Each time Karma fetches a file with the webpack preprocessor, it raises the following warning:

Fetching src/ExampleTest.js
Warning: .then() only accepts functions but was passed: [object Undefined], [object Undefined]
    at then (node_modules/karma/lib/middleware/common.js:14:39)
    at node_modules/karma/lib/middleware/source_files.js:29:25
    at call (node_modules/connect/index.js:239:7)
    at next (node_modules/connect/index.js:183:5)
    at node_modules/karma/lib/middleware/karma.js:231:12
    at call (node_modules/connect/index.js:239:7)
    at next (node_modules/connect/index.js:183:5)
    at node_modules/karma/lib/middleware/strip_host.js:13:5
    at call (node_modules/connect/index.js:239:7)
    at next (node_modules/connect/index.js:183:5)
    at node_modules/karma/lib/middleware/stopper.js:9:50
    at call (node_modules/connect/index.js:239:7)

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions