Skip to content

Test runner doesn't return correct failure code if run in node script #26

@gabaum10

Description

@gabaum10

Take this setup for example:

  • Node script that looks like this:
"scripts": {
    "prequnit": "webpack --config ./webpack.config-qunit.js",
    "qunit": "node ./scripts/runQunit.js",
}

The pre step compiles the necessary entry files for the tests. Then the runQunit.js file looks like this:

const qunit = require('node-qunit-phantomjs'); // eslint-disable-line

qunit('./src/test/resources/qunit/test1.js.html', {verbose: true});
qunit('./src/test/resources/qunit/test2.js.html', {verbose: true});
qunit('./src/test/resources/qunit/test3.js.html', {verbose: true});

If one of those tests fail, it prints an error to the console, but doesn't return a valid error code that would kill something like CircleCI. Is there a flag in the nodeJS implementation to cause the script to fail completely if any of the qunit calls fail?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions