1
我使用gulp-notify
获得通过和失败的黄瓜步骤的通知。吞食通知不成功的黄瓜步骤
事情是,我只收到通知,当它失败,而不是当测试通过。
没有错误被抛出,但终端显示通过测试,我没有收到任何通知。
这里我Gulpfile.js的内容:
var gulp = require('gulp');
var cucumber = require('gulp-cucumber');
var notify = require('gulp-notify');
gulp.task('cucumber', function() {
gulp.src('*features/*')
.pipe(cucumber({
'steps': '*features/step_definitions/*.js',
'support': '*features/support/*.js'
}))
.on('error', notify.onError({
title: 'Red',
message: 'Your test(s) failed'
}))
.pipe(notify({
title: 'Green',
message: 'All tests passed (you can refactor)'
}));
});
gulp.task('watch', function() {
gulp.watch(['features/**/*.feature', 'features/**/*.js', 'script/**/*.js'], ['cucumber']);
});
gulp.task('default', ['watch']);
任何想法我可能会错过?