mardi 23 février 2016

VS 2015 integration with Gulp JS unit tests

I am using Gulp + Karma to run my Jasmine Javascript tests under PhantomJS (headless browser).

This works fine and the output of each test is sent to the Task Runner Explorer window. I want to be able to report those tests within VS though. Specifically I want to do so within an automated build environment such that if they fail during the automated build process I want to be notified as it would be if a standard C# unit test failed.

How can I get this working?

Here is my current test task

gulp.task('test', function (coverage) {
    gulp.src(allFiles)
    .pipe(karma({
        configFile: 'karma.conf.js',
        action: 'run'
    }))
    .on('error', function (err) {
        // Make sure failed tests cause gulp to exit non-zero
        console.log("error: tests failed");
        throw err;
    });
});

Aucun commentaire:

Enregistrer un commentaire