@@ -18,9 +18,7 @@ const BUILD_TARGET_DIR = './';
18
18
gulp . task ( 'default' , [ 'build' ] ) ;
19
19
20
20
gulp . task ( 'build' , function ( ) {
21
- return gulp . src ( [ 'lib/*.js' , 'lib/transports/*.js' ] , {
22
- base : 'lib'
23
- } )
21
+ return gulp . src ( 'lib/**/*.js' )
24
22
. pipe ( webpack ( require ( './support/webpack.config.js' ) ) )
25
23
. pipe ( gulp . dest ( BUILD_TARGET_DIR ) ) ;
26
24
} ) ;
@@ -29,9 +27,12 @@ gulp.task('build', function () {
29
27
// TESTING
30
28
// //////////////////////////////////////
31
29
32
- const REPORTER = 'dot' ;
33
30
const TEST_FILE = './test/index.js' ;
34
- const TEST_SUPPORT_SERVER_FILE = './test/support/server.js' ;
31
+ const MOCHA_OPTS = {
32
+ reporter : 'dot' ,
33
+ require : [ './test/support/server.js' ] ,
34
+ bail : true
35
+ } ;
35
36
const FILES_TO_CLEAN = [
36
37
'test/support/public/engine.io.js'
37
38
] ;
@@ -60,11 +61,6 @@ gulp.task('test-node', testNode);
60
61
gulp . task ( 'test-zuul' , testZuul ) ;
61
62
62
63
function testNode ( ) {
63
- const MOCHA_OPTS = {
64
- reporter : REPORTER ,
65
- require : [ TEST_SUPPORT_SERVER_FILE ] ,
66
- bail : true
67
- } ;
68
64
return gulp . src ( TEST_FILE , { read : false } )
69
65
. pipe ( mocha ( MOCHA_OPTS ) )
70
66
// following lines to fix gulp-mocha not terminating (see gulp-mocha webpage)
@@ -113,16 +109,16 @@ gulp.task('istanbul-pre-test', function () {
113
109
} ) ;
114
110
115
111
gulp . task ( 'test-cov' , [ 'istanbul-pre-test' ] , function ( ) {
116
- return gulp . src ( [ 'test/*.js' , 'test/support/*.js' ] )
117
- . pipe ( mocha ( {
118
- reporter : REPORTER
119
- } ) )
112
+ return gulp . src ( TEST_FILE )
113
+ . pipe ( mocha ( MOCHA_OPTS ) )
120
114
. pipe ( istanbul . writeReports ( ) )
121
115
. once ( 'error' , function ( err ) {
116
+ cleanFiles ( FILES_TO_CLEAN ) ;
122
117
console . error ( err . stack ) ;
123
118
process . exit ( 1 ) ;
124
119
} )
125
120
. once ( 'end' , function ( ) {
121
+ cleanFiles ( FILES_TO_CLEAN ) ;
126
122
process . exit ( ) ;
127
123
} ) ;
128
124
} ) ;
0 commit comments