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

Not a gulp plugin #4

Open
callumacrae opened this issue Apr 15, 2015 · 2 comments
Open

Not a gulp plugin #4

callumacrae opened this issue Apr 15, 2015 · 2 comments

Comments

@callumacrae
Copy link

There's no reason for this to be a gulp plugin, and it doesn't directly deal with file objects, so it has been blacklisted:

gulpjs/plugins#185

There's not much you can do to make it a gulp plugin, either; if CasperJS had a programmatic API then you could use that, but they don't 😞

@ZAYEC77
Copy link
Contributor

ZAYEC77 commented Apr 16, 2015

@callumacrae, You have a better way to use CasperJS with Gulp?

@callumacrae
Copy link
Author

Yep

var spawn = require('child_process').spawn;
var gulp = require('gulp');
var gutil = require('gulp-util');

gulp.task('test', function () {
    var tests = ['myTests.js'];

    var casperChild = spawn('casperjs', ['test'].concat(tests));

    casperChild.stdout.on('data', function (data) {
        gutil.log('CasperJS:', data.toString().slice(0, -1));
    });

    casperChild.on('close', function (code) {
        var success = code === 0; // Will be 1 in the event of failure

        // Do something with success here
    });
});

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