Skip to content

There should be a big, fat warning about this plugin sharing state between mocha runs in a watch task #110

@coaxial

Description

@coaxial

I switched to Gulp not too long ago and I setup a watch task to run my mocha tests as soon as one of the code or spec files are saved.

For a couple of weeks I couldn't understand what I was doing wrong and why my tests eventually kept on failing in the watch task but were fine when run from the CLI with mocha test.

I eventually discovered that it's because gulp-mocha runs the tests in the same process as Gulp and so mocha's state isn't 100% reset between runs.

Then I came across gulp-spawn-mocha which addresses this very issue.

The README should come with a warning when using gulp-mocha in a watch task. I wasted a lot of time trying to figure it out and was almost ready to give up Gulp.

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