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

gulp-casperjs: How to fail the build? #9

Open
skananitos opened this issue Jun 17, 2016 · 3 comments
Open

gulp-casperjs: How to fail the build? #9

skananitos opened this issue Jun 17, 2016 · 3 comments

Comments

@skananitos
Copy link

Hi, I want my Gulp build to fail, if there are errors in CasperJS tests. Is there a possibility to use something like "fail reporter"?

@ZAYEC77
Copy link
Contributor

ZAYEC77 commented Jun 18, 2016

Hello, thanks for issue
Can you give some usage example of your case?
I mean part of gulpfile etc.

@skananitos
Copy link
Author

skananitos commented Jun 20, 2016

Hi @ZAYEC77, thanks for your reply. So the following is a part of my Gulp file:

var casperJs   = require("gulp-casperjs");
...
// casperjs runs on phantomjs
gulp.task("test", function () {
    gulp.src("tests/maintest.js")
    .pipe(casperJs())
});
...
gulp.task("dev", [
    "watch",
    "serve",
    "test"
]);

The solution that I found is to include the gulp-exit dependency on my code. So, I updated it as:

var casperJs   = require("gulp-casperjs"),
      exit          = require("gulp-exit");
...
// casperjs runs on phantomjs
gulp.task("test", function () {
    gulp.src("tests/portaltest.js")
    .pipe(casperJs())
    .pipe(exit());
});

Do you have to propose me a better approach?

@ZAYEC77
Copy link
Contributor

ZAYEC77 commented Jun 30, 2016

@skananitos Do you use gulp-exit for termination of casperjs, do you have problem with this?
Or you want better fail report?

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

No branches or pull requests

2 participants