Why, when the test fails, does Jenkins still talk about success?

I have a MEAN project. Using Jenkins on an EC2 computer, I create it using the following shell script:

npm install && PORT=8888 npm test

mocha returns 2 (the number of failed tests), but still Jenkins says:

Finished: SUCCESS.

If tests fail, I expect to see

Finished: FAILURE

Do you know why it is not working properly?

+4
source share
2 answers

You can:

  • Use a test runner like Karma, or
  • Tell Mocha to report, for example, in XUnit format by passing the Mocha flag --reporter xunit. XUnit is closely related to JUnit, which Jenkins understands, or
  • - mocha-jenkins-reporter - .
+3

: Jenkins Test Finder " - " ( ), "".

+2

All Articles