pass variable from gulp file to mocha test file

59 Views Asked by At

I am trying execute mocha test file through gulp using gulp-mocha. Such that I need variable to be passed(or pipe) to mocha test file which can be accessed in mocha test file. How can I achieve this one

1

There are 1 best solutions below

1
user2347763 On

To use a test file,

  gulp.task('taskname', function (done) {
        gulp.src('test/testfile.js')
            .pipe(gulpmocha(),setTimeout(function() {
                done(null);
        }, 5000))
    });

To pass a variable, you may need to post your code and test