Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in plugin after a failed test #25

Open
twinstone opened this issue Oct 19, 2015 · 4 comments
Open

Error in plugin after a failed test #25

twinstone opened this issue Oct 19, 2015 · 4 comments
Labels

Comments

@twinstone
Copy link

I have troubles running this plugin. I a test runner has all tests passed then everything is ok, but when some test fails, the plugin ends with error:

[00:09:37] Error in plugin 'gulp-qunit'
Message:
    Command failed: PATH_TO_PROJECT\node_modules\gulp-qunit\node_modules\phantomjs\lib\phantom\phantomjs.exe PATH_TO_PROJECT\node_modules\gulp-qunit\node_modules\qunit-phantomjs-runner\runner-json.js file:///w:/projects/Twinstone/TDI/src/tests/test.html 10

Details:
    killed: false
    code: 1
    signal: null
    cmd: PATH_TO_PROJECT\node_modules\gulp-qunit\node_modules\phantomjs\lib\phantom\phantomjs.exe PATH_TO_PROJECT\node_modules\gulp-qunit\node_modules\qunit-phantomjs-runner\runner-json.js file:///w:/projects/Twinstone/TDI/src/tests/test.html 10

It crashes event with the simplest test:

<!DOCTYPE html>
<html>
<head>
    <title>Test1</title>
    <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.19.0.css">
</head>
<body>
    <div id="qunit"></div>
    <div id="qunit-fixture"></div>

    <script src="http://code.jquery.com/qunit/qunit-1.19.0.js"></script>
    <script>
        QUnit.test("Test1", function(assert) {
            assert.ok(false, "lorem");
        });
    </script>
</body>
</html>

Gulpfile:

...
gulp.task('test', function () {
    return gulp.src('test.html')
        .pipe(qunit());
});
...

Any idea what is wrong, or what do I do wrong?

windows
node: v4.1.2
gulp-qunit: 1.2.1

@twinstone
Copy link
Author

If I run the command manually in console, it looks like everything is running fine. This is the JSON it returns:

{  
   "result":{  
      "failed":1,
      "passed":0,
      "total":1,
      "runtime":5
   },
   "exceptions":{  
      "Test1":[  
         "Failed assertion: lorem, expected: true, but was: false",
         "at http://code.jquery.com/qunit/qunit-1.19.0.js:1307",
         "at file:///PATH_TO_PROJECT/tests/test.html:14",
         "at http://code.jquery.com/qunit/qunit-1.19.0.js:810",
         "at http://code.jquery.com/qunit/qunit-1.19.0.js:942",
         "at process (http://code.jquery.com/qunit/qunit-1.19.0.js:624)",
         "at begin (http://code.jquery.com/qunit/qunit-1.19.0.js:606)",
         "at http://code.jquery.com/qunit/qunit-1.19.0.js:666"
      ]
   }
}

@ghost
Copy link

ghost commented Dec 8, 2015

I am having the same issue. How did you run the plugin from the command line directly?

@jonkemp
Copy link
Owner

jonkemp commented Dec 12, 2015

It errors because it is specifically told to if a test fails.

https://github.com/jonkemp/gulp-qunit/blob/master/index.js#L82

Isn't that desired behavior though?

@jonkemp
Copy link
Owner

jonkemp commented Dec 12, 2015

I added a test with a failing test. I also added a task to the gulpfile that simply logs the errors without stopping the stream.

https://github.com/jonkemp/gulp-qunit/blob/master/gulpfile.js#L30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant