Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 gulp-mocha 通过 gulp 执行 mocha 测试文件。这样我需要将变量传递(或管道)到 mocha 测试文件,该文件可以在 mocha 测试文件中访问。我怎样才能实现这一目标
要使用测试文件,
gulp.task('taskname', function (done) { gulp.src('test/testfile.js') .pipe(gulpmocha(),setTimeout(function() { done(null); }, 5000)) });
要传递变量,您可能需要发布代码并进行测试