gulp-jest

    4.0.4 • Public • Published

    Build Status Code Climate Test Coverage

    gulp-jest

    Gulp plugin for the Jest test library

    Installation

    $ npm install gulp-jest jest

    Usage

    var jest = require('gulp-jest').default;
    
    gulp.task('jest', function () {
      return gulp.src('__tests__').pipe(jest({
        "preprocessorIgnorePatterns": [
          "<rootDir>/dist/", "<rootDir>/node_modules/"
        ],
        "automock": false
      }));
    });

    process.env.NODE_ENV

    Unlike the jest CLI tool, gulp-jest does not automatically set process.env.NODE_ENV to be test. If you are using Webpack or Babel, you may need to manually set process.env.NODE_ENV prior to running the task itself.

    gulp.task('jest', function () {
      process.env.NODE_ENV = 'test';
      
      return gulp.src('__tests__').pipe(jest({
        ...
      }));
    });

    API

    jest(options)

    options

    as per Jest config

    License

    MIT © Dominic Barker

    Install

    npm i gulp-jest

    DownloadsWeekly Downloads

    7,398

    Version

    4.0.4

    License

    MIT

    Unpacked Size

    6.09 kB

    Total Files

    7

    Last publish

    Collaborators

    • dakuan
    • alansouzati
    • aarontrank
    • nerajno