stjohnjohnson / jenkins-mocha

Bin wrapper for Mocha + Istanbul + Xunit (for Jenkins)
https://www.npmjs.com/package/jenkins-mocha
MIT License
20 stars 16 forks source link

Test never kill #33

Open ariden83 opened 7 years ago

ariden83 commented 7 years ago

Hello,

When I my tests, with :

NODE_ENV='test' NO_PROXY=* jenkins-mocha test.js

The command:

shell.exit(shell.exec(command.join(' ')).code);

execute :

node '/.../node_modules/.bin/nyc' --reporter lcov --reporter text-summary --report-dir /.../artifacts/coverage -- node '/.../node_modules/jenkins-mocha/node_modules/.bin/_mocha' --reporter '/.../node_modules/spec-xunit-file/index.js' --colors 'test.js'

My tests are ok, I've got this message :

X passing (Xs)

artifacts folder and files are weel created

But Test are never kill, Jenkins cannot pass to next step.

Here ar my devDependencies :

 "devDependencies": {
    "bunyan": "^1.8.1",
    "chai": "3.5.0",
    "chai-as-promised": "5.3.0",
    "eslint": "^3.0.1",
    "gulp": "^3.9.0",
    "istanbul": "^0.4.3",
    "jenkins-mocha": "6.0.0",
    "mocha": "^2.5.3",
    "mocha-jenkins-reporter": "0.3.10",
    "nock": "9.1.0",
    "node-dev": "3.1.3",
    "portfinder": "1.0.3",
    "uuid": "2.0.2"
  }

If I launch my tests :

NODE_ENV='test' NO_PROXY=* istanbul cover _mocha test.js

Tests are good and script was kill automaticly at the end.

Do you know why ?

Thx

ariden83 commented 7 years ago

Note: If I use "jenkins-mocha": "5.0.0". I don't have this problem.

stjohnjohnson commented 7 years ago

It should be related to: https://boneskull.com/mocha-v4-nears-release/#mochawontforceexit