简体   繁体   中英

Tests result as successful, although errors are found during Tests

I have set up my test environment as described here with QunitJS + PhantomJS + GruntJS: http://jordankasper.com/blog/2013/04/automated-javascript-tests-using-grunt-phantomjs-and-qunit/

Everything works fine, but I have the problem that, my Grunt Task finishes without errors, although errors are found. This is crucial for my build process. Due to the Test results the build either fails or succeeds. But in my case the build always succeeds. Any Ideas why grunt doesn't exit with failure when errors found?

qunit Task of the grunt file:

module.exports = {

  services: {
    options: {
      urls: [
        'http://localhost:8000/tests/services.html'
      ],
      timeout: 20000,
      force: true
    }
  },

  gui: {
    options: {
      urls: [
        'http://localhost:8000/tests/gui.html'
      ],
      timeout: 20000,
      force: true
    }
  }

};

Output:

在此处输入图片说明

Please consider that I cant upload more info due to confidental issues.

You are asking 'why does Grunt continue and when the tests fail?' The answer is 'because you are asking it to'.

The force option controls whether the QUnit task fails if there are failing tests. Setting it to true as you have done tells Grunt to continue even if there are failing tests. Try setting it to false , or removing it altogether as false is the default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM