Skip to content

Crashing on uncaught asynchronous exception #55

Description

@jbblanchet

Given this gulp task:

gulp.task('test', function() {
    return gulp.src("*.spec.js")
        .pipe(jasmine());
});

and this spec:

describe("a test", function () {
    it("should work", function (done) {
        setTimeout(function () {
            throw "Exception";
            done();
        }, 1);
    });
});

the output will be:

[16:24:21] Starting 'test'...
Running 1 specs.

a test
C:\POC\test-gulp-jasmine\test.spec.js:4
            throw "Exception";
            ^
Exception

It would be nice to be able to catch the exception and return gracefully, but I guess this must be managed by jasmine directly and might not be possible at all.

Things that could be related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions