gulp-jest

Why “gulp-jest” is failing with: “Please run node with the --harmony flag!”?

亡梦爱人 提交于 2020-01-02 06:31:15
问题 I get the following error when running gulp test : Error: Please run node with the --harmony flag! Here is my gulp task: var jest = require('gulp-jest'); gulp.task('test', function() { return gulp.src('src/**/__tests__').pipe(jest({ rootDir: 'src', scriptPreprocessor: '../node_modules/6to5-jest', unmockedModulePathPatterns: [ 'react' ] })); }); To reproduce: https://github.com/SEEK-Jobs/react-playground Note that npm test works properly (test is failing as expected), but gulp test fails with

Jest can not deal with insertAdjacentElement?

自作多情 提交于 2019-12-12 11:06:01
问题 I want to test a quite simple JS function export function displaySpinner() { const loadingOverlayDOM = document.createElement('DIV'); const spinner = document.createElement('IMG'); loadingOverlayDOM.id = 'overlay-spinner'; loadingOverlayDOM.className = 'content-overlay'; spinner.className = 'is-spinning'; spinner.setAttribute('src', '/assets/img/svg/icons/spinner.svg'); l loadingOverlayDOM.insertAdjacentElement('beforeend', spinner); document.body.insertAdjacentElement('beforeend',

Why “gulp-jest” is failing with: “Please run node with the --harmony flag!”?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 12:39:48
I get the following error when running gulp test : Error: Please run node with the --harmony flag! Here is my gulp task: var jest = require('gulp-jest'); gulp.task('test', function() { return gulp.src('src/**/__tests__').pipe(jest({ rootDir: 'src', scriptPreprocessor: '../node_modules/6to5-jest', unmockedModulePathPatterns: [ 'react' ] })); }); To reproduce: https://github.com/SEEK-Jobs/react-playground Note that npm test works properly (test is failing as expected), but gulp test fails with the error above. Both npm test and gulp test have the same config object: { rootDir: 'src',