Skip to content

Parallel streams using gulp-jasmine prevent tests from all streams from being run. #42

Description

@mandragorn

If one stream is running with gulp-jasmine and another stream uses gulp-jasmine then only the stream that completes first will actually run that streams tests (the tests from the other stream are not run).

Example test:

it('should run all tests when new tests are added while running tests.', function (done) {
    var numTasks = 0;
    var output = '';
    var oldWrite = process.stdout.write;
    process.stdout.write = function (str) {
        output += str;
    };
    var startStream = function() {
        numTasks++;
        var stream = jasmine({
            timeout: 9000,
            verbose: true
        });
        var reader = through2.obj(function (file, enc, cb) {
            cb();
        }, function (cb) {
            process.stdout.write = out;
            assert.equal(output.match(/should pass another test: passed/g).length, 1);
            if (--numTasks <= 0) {
                done();
            }
            cb();
        });

        stream.pipe(reader);

        return stream;
    };

    var otherFixtureStream = startStream();
    var fixtureStream = startStream();


    fixtureStream.write(new gutil.File({
        path: 'fixture.js',
        contents: new Buffer('')
    }));

    otherFixtureStream.write(new gutil.File({
        path: 'otherFixture.js',
        contents: new Buffer('')
    }));

    fixtureStream.end();
    otherFixtureStream.end();
});

otherFixture.js:

describe('other fixture', function () {
    it('should pass another test', function (done) {
        expect(1).toBe(1);
        done();
    });
});

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