-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e008ffe
commit 7cbdd5e
Showing
22 changed files
with
606 additions
and
572 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "standard", | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"yoda": 0, | ||
"semi": [2, "always"], | ||
"no-extra-semi": 2, | ||
"semi-spacing": [2, { "before": false, "after": true }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,52 @@ | ||
var gulp = require('gulp'); | ||
var mocha = require('gulp-mocha'); | ||
var babel = require("gulp-babel"); | ||
var nsp = require('gulp-nsp'); | ||
const gulp = require('gulp'); | ||
const mocha = require('gulp-mocha'); | ||
const babel = require('gulp-babel'); | ||
const nsp = require('gulp-nsp'); | ||
const eslint = require('gulp-eslint'); | ||
|
||
var TESTS = 'test/*.js'; | ||
var REPORTER = 'dot'; | ||
const TESTS = 'test/*.js'; | ||
const REPORTER = 'dot'; | ||
|
||
gulp.task("default", ["transpile"]); | ||
gulp.task('default', ['transpile']); | ||
|
||
gulp.task('test', ['nsp'], function(){ | ||
if (parseInt(process.versions.node) < 4 && process.env.EIO_WS_ENGINE == 'uws') { | ||
console.info("Node version < 4, skipping tests with uws engine"); | ||
process.exit(); | ||
} | ||
return gulp.src(TESTS, {read: false}) | ||
gulp.task('test', ['nsp', 'lint'], function () { | ||
if (parseInt(process.versions.node, 10) < 4 && process.env.EIO_WS_ENGINE === 'uws') { | ||
console.info('Node version < 4, skipping tests with uws engine'); | ||
process.exit(); | ||
} | ||
return gulp.src(TESTS, {read: false}) | ||
.pipe(mocha({ | ||
slow: 500, | ||
reporter: REPORTER, | ||
bail: true | ||
})) | ||
.once('error', function(){ | ||
.once('error', function (err) { | ||
console.error(err.stack); | ||
process.exit(1); | ||
}) | ||
.once('end', function(){ | ||
.once('end', function () { | ||
process.exit(); | ||
}); | ||
}); | ||
|
||
gulp.task('lint', function () { | ||
return gulp.src([ | ||
'*.js', | ||
'lib/**/*.js', | ||
'test/**/*.js' | ||
]) | ||
.pipe(eslint()) | ||
.pipe(eslint.format()) | ||
.pipe(eslint.failAfterError()); | ||
}); | ||
|
||
// By default, individual js files are transformed by babel and exported to /dist | ||
gulp.task("transpile", function(){ | ||
return gulp.src(["lib/*.js","lib/transports/*.js"], { base: 'lib' }) | ||
.pipe(babel({ "presets": ["es2015"] })) | ||
.pipe(gulp.dest("dist")); | ||
gulp.task('transpile', function () { | ||
return gulp.src(['lib/**/*.js'], { base: 'lib' }) | ||
.pipe(babel({ 'presets': ['es2015'] })) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('nsp', function (cb) { | ||
nsp({package: __dirname + '/package.json'}, cb) | ||
}) | ||
nsp({package: __dirname + '/package.json'}, cb); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.