如何使用mochaPhantomJS& amp;将任意参数传递给我的mocha测试?吞掉?

时间:2015-03-17 01:30:50

标签: javascript phantomjs gulp mocha mocha-phantomjs

我正在使用gulp& mochaPhantomJS。我想使用相同的测试html并针对它运行不同的测试。如何传递任意参数(我的意思是幻影args),我可以从我的测试JavaScript中检索它?

var gulp = require('gulp');
var mochaPhantomJS = require('gulp-mocha-phantomjs');

gulp.task('testMisc', function() {
    return gulp.src('testMisc.html')
        .pipe(mochaPhantomJS());
});

但要清楚我想要做的是

gulp.task('testMisc-1', function() {
    return gulp.src('testMisc.html')
        .pipe(mochaPhantomJS({whatever:1}));
});

gulp.task('testMisc-2', function() {
    return gulp.src('testMisc.html')
        .pipe(mochaPhantomJS({whatever:2}));
});

0 个答案:

没有答案
相关问题