Skip to content

Commit

Permalink
feat: Introduce jest-image-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeng committed Oct 3, 2019
1 parent 2bb9f05 commit eca70c9
Show file tree
Hide file tree
Showing 8 changed files with 6,413 additions and 1,918 deletions.
11 changes: 10 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var csslint = require('gulp-csslint');
var cleanCSS = require('gulp-clean-css');
var sourcemaps = require('gulp-sourcemaps');
var testcafe = require('gulp-testcafe');
var jest = require('gulp-jest').default;
var paths = {
src: 'src',
srcFiles: 'src/**/*',
Expand Down Expand Up @@ -63,11 +64,19 @@ gulp.task('addAssets', gulp.series('integration-tests', function () {
return merge(fontawesomeCSS, fontawesomeFonts, jsFiles, cssFiles);
}));

gulp.task('visual-regression', function () {
return gulp.src('test').pipe(jest({
"testMatch": ['**/test/visual-regression/**/test.js']
}));
});

gulp.task('e2e-tests', gulp.series('addAssets', function () {
return gulp.src('test/e2e/**/test.js')
.pipe(testcafe({ browsers: ['chrome:headless', 'firefox:headless'] }));
}));

gulp.task('test', gulp.series('e2e-tests', 'visual-regression'));

gulp.task('cleanupJS', function() {
return del([paths.distJSFolder + '/**']);
});
Expand All @@ -78,7 +87,7 @@ gulp.task('eslint', function () {
.pipe(eslint.failOnError());
});

gulp.task('js', gulp.series('cleanupJS', 'eslint', 'e2e-tests', function () {
gulp.task('js', gulp.series('cleanupJS', 'eslint', 'test', function () {
return gulp.src(paths.srcJS)
.pipe(gulp.dest(paths.distJSFolder))
.pipe(sourcemaps.init())
Expand Down
Loading

0 comments on commit eca70c9

Please sign in to comment.