Skip to content

Commit

Permalink
ES2015ify
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 11, 2017
1 parent 018cd95 commit ecd7ffa
Show file tree
Hide file tree
Showing 28 changed files with 625 additions and 780 deletions.
137 changes: 0 additions & 137 deletions .eslintrc

This file was deleted.

54 changes: 21 additions & 33 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
'use strict';
var path = require('path');
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var excludeGitignore = require('gulp-exclude-gitignore');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var nsp = require('gulp-nsp');
var plumber = require('gulp-plumber');
var coveralls = require('gulp-coveralls');

gulp.task('static', function () {
return gulp.src('**/*.js')
.pipe(excludeGitignore())
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('nsp', function (cb) {
const path = require('path');
const gulp = require('gulp');
const mocha = require('gulp-mocha');
const istanbul = require('gulp-istanbul');
const nsp = require('gulp-nsp');
const plumber = require('gulp-plumber');
const coveralls = require('gulp-coveralls');

gulp.task('nsp', cb => {
nsp({package: path.resolve('package.json')}, cb);
});

gulp.task('pre-test', function () {
return gulp.src('lib/**/*.js')
.pipe(istanbul({
includeUntested: true
}))
.pipe(istanbul.hookRequire());
});
gulp.task('pre-test', () =>
gulp.src('lib/**/*.js')
.pipe(istanbul({includeUntested: true}))
.pipe(istanbul.hookRequire())
);

gulp.task('test', ['pre-test'], function (cb) {
var mochaErr;
gulp.task('test', ['pre-test'], cb => {
let mochaErr;

// will disable cache for completion tests
// Will disable cache for completion tests
process.env.YO_TEST = 1;

gulp.src('test/**/*.js')
.pipe(plumber())
.pipe(mocha({reporter: 'spec'}))
.on('error', function (err) {
.on('error', err => {
mochaErr = err;
})
.pipe(istanbul.writeReports())
.on('end', function () {
.on('end', () => {
cb(mochaErr);
});
});

gulp.task('coveralls', ['test'], function () {
gulp.task('coveralls', ['test'], () => {
if (!process.env.CI) {
return;
}
Expand All @@ -57,4 +45,4 @@ gulp.task('coveralls', ['test'], function () {
});

gulp.task('prepublish', ['nsp']);
gulp.task('default', ['static', 'test', 'coveralls']);
gulp.task('default', ['test', 'coveralls']);
Loading

0 comments on commit ecd7ffa

Please sign in to comment.