@@ -28,17 +28,12 @@ var runSequence = require('run-sequence');
2828// File I/O
2929var fs = require ( 'fs' ) ;
3030var exit = require ( 'gulp-exit' ) ;
31- var tslint = require ( 'gulp-tslint' ) ;
3231var ts = require ( 'gulp-typescript' ) ;
3332var del = require ( 'del' ) ;
3433var merge = require ( 'merge2' ) ;
3534var header = require ( 'gulp-header' ) ;
3635var replace = require ( 'gulp-replace' ) ;
3736
38- // Testing
39- var mocha = require ( 'gulp-mocha' ) ;
40- var istanbul = require ( 'gulp-istanbul' ) ;
41-
4237
4338/****************/
4439/* FILE PATHS */
@@ -52,28 +47,13 @@ var paths = {
5247 'src/**/*.js'
5348 ] ,
5449
55- tests : [
56- 'test/unit/utils.ts' ,
57- 'test/unit/**/*.spec.ts' ,
58- 'test/resources/mocks.ts'
59- ] ,
60-
61- resources : [
62- 'test/resources/*.json'
63- ] ,
64-
6550 build : 'lib/' ,
66-
67- testBuild : '.tmp/' ,
68-
69- testRunner : [ '.tmp/test/unit/index.spec.js' ]
7051} ;
7152
7253// Create a separate project for buildProject that overrides the rootDir
7354// This ensures that the generated production files are in their own root
7455// rather than including both src and test in the lib dir.
7556var buildProject = ts . createProject ( 'tsconfig.json' , { rootDir : 'src' } ) ;
76- var testProject = ts . createProject ( 'tsconfig.json' ) ;
7757
7858var banner = `/*! firebase-admin v${ pkg . version } */\n` ;
7959
@@ -84,7 +64,6 @@ var banner = `/*! firebase-admin v${pkg.version} */\n`;
8464gulp . task ( 'cleanup' , function ( ) {
8565 return del ( [
8666 paths . build ,
87- paths . testBuild
8867 ] ) ;
8968} ) ;
9069
@@ -122,54 +101,9 @@ gulp.task('copyTypings', function() {
122101 . pipe ( gulp . dest ( paths . build ) )
123102} ) ;
124103
125- // Lints the source and test files
126- gulp . task ( 'lint' , function ( ) {
127- let filesToLint = _ . clone ( paths . src . concat ( paths . tests ) ) ;
128-
129- // Don't lint the hand-crafted TypeScript typings file
130- filesToLint . push ( '!src/index.d.ts' ) ;
131-
132- return gulp . src ( filesToLint )
133- . pipe ( tslint ( ) )
134- . pipe ( tslint . report ( {
135- summarizeFailureOutput : true
136- } ) ) ;
137- } ) ;
138-
139- // Runs the test suite
140- gulp . task ( 'test' , function ( ) {
141- merge (
142- // Copy compiled source and test files
143- gulp . src ( paths . tests . concat ( paths . src ) , { base : '.' } )
144- . pipe ( testProject ( ) )
145- . pipe ( gulp . dest ( paths . testBuild ) ) ,
146- // Copy compiled database files
147- gulp . src ( paths . build + 'database/**/*' )
148- . pipe ( gulp . dest ( paths . testBuild + 'src/database/' ) ) ,
149- // Copy test resources
150- gulp . src ( paths . resources , { base : '.' } )
151- . pipe ( gulp . dest ( paths . testBuild ) )
152- ) . on ( 'finish' , function ( ) {
153- return gulp . src ( [ paths . testBuild + 'src/**/*.js' , '!' + paths . testBuild + 'src/database/**/*' ] )
154- . pipe ( istanbul ( ) )
155- . pipe ( istanbul . hookRequire ( ) )
156- . on ( 'finish' , function ( ) {
157- return gulp . src ( paths . testRunner )
158- . pipe ( mocha ( {
159- reporter : 'spec' ,
160- timeout : 5000
161- } ) )
162- . pipe ( istanbul . writeReports ( ) )
163- . on ( 'finish' , function ( ) {
164- return del ( paths . testBuild ) . then ( exit ) ;
165- } ) ;
166- } ) ;
167- } )
168- } ) ;
169-
170- // Re-runs the linter and regenerates js every time a source file changes
104+ // Regenerates js every time a source file changes
171105gulp . task ( 'watch' , function ( ) {
172- gulp . watch ( paths . src , [ 'lint' , ' compile'] ) ;
106+ gulp . watch ( paths . src , [ 'compile' ] ) ;
173107} ) ;
174108
175109// Build task
@@ -181,7 +115,7 @@ gulp.task('build', function(done) {
181115
182116// Default task
183117gulp . task ( 'default' , function ( done ) {
184- runSequence ( 'lint' , ' build' , 'test ', function ( error ) {
118+ runSequence ( 'build' , function ( error ) {
185119 done ( error && error . err ) ;
186120 } ) ;
187121} ) ;
0 commit comments