@@ -28,17 +28,12 @@ var runSequence = require('run-sequence');
28
28
// File I/O
29
29
var fs = require ( 'fs' ) ;
30
30
var exit = require ( 'gulp-exit' ) ;
31
- var tslint = require ( 'gulp-tslint' ) ;
32
31
var ts = require ( 'gulp-typescript' ) ;
33
32
var del = require ( 'del' ) ;
34
33
var merge = require ( 'merge2' ) ;
35
34
var header = require ( 'gulp-header' ) ;
36
35
var replace = require ( 'gulp-replace' ) ;
37
36
38
- // Testing
39
- var mocha = require ( 'gulp-mocha' ) ;
40
- var istanbul = require ( 'gulp-istanbul' ) ;
41
-
42
37
43
38
/****************/
44
39
/* FILE PATHS */
@@ -52,28 +47,13 @@ var paths = {
52
47
'src/**/*.js'
53
48
] ,
54
49
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
-
65
50
build : 'lib/' ,
66
-
67
- testBuild : '.tmp/' ,
68
-
69
- testRunner : [ '.tmp/test/unit/index.spec.js' ]
70
51
} ;
71
52
72
53
// Create a separate project for buildProject that overrides the rootDir
73
54
// This ensures that the generated production files are in their own root
74
55
// rather than including both src and test in the lib dir.
75
56
var buildProject = ts . createProject ( 'tsconfig.json' , { rootDir : 'src' } ) ;
76
- var testProject = ts . createProject ( 'tsconfig.json' ) ;
77
57
78
58
var banner = `/*! firebase-admin v${ pkg . version } */\n` ;
79
59
@@ -84,7 +64,6 @@ var banner = `/*! firebase-admin v${pkg.version} */\n`;
84
64
gulp . task ( 'cleanup' , function ( ) {
85
65
return del ( [
86
66
paths . build ,
87
- paths . testBuild
88
67
] ) ;
89
68
} ) ;
90
69
@@ -122,54 +101,9 @@ gulp.task('copyTypings', function() {
122
101
. pipe ( gulp . dest ( paths . build ) )
123
102
} ) ;
124
103
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
171
105
gulp . task ( 'watch' , function ( ) {
172
- gulp . watch ( paths . src , [ 'lint' , ' compile'] ) ;
106
+ gulp . watch ( paths . src , [ 'compile' ] ) ;
173
107
} ) ;
174
108
175
109
// Build task
@@ -181,7 +115,7 @@ gulp.task('build', function(done) {
181
115
182
116
// Default task
183
117
gulp . task ( 'default' , function ( done ) {
184
- runSequence ( 'lint' , ' build' , 'test ', function ( error ) {
118
+ runSequence ( 'build' , function ( error ) {
185
119
done ( error && error . err ) ;
186
120
} ) ;
187
121
} ) ;
0 commit comments