File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
+ let validatedVersion = false ;
18
+
17
19
function validateNamespace ( definition , candidate ) {
18
20
const __expect = require ( 'chai' ) . expect ;
19
21
const keys = Object . keys ( definition ) . filter ( key => ! ~ key . indexOf ( '__' ) ) ;
20
22
23
+ if ( ! validatedVersion ) {
24
+ describe ( 'Firebase SDK Version' , function ( ) {
25
+ it ( 'Should be properly defined' , function ( ) {
26
+ __expect ( candidate . SDK_VERSION ) . to . equal (
27
+ require ( '../../packages/firebase/package.json' ) . version
28
+ ) ;
29
+ } ) ;
30
+ } ) ;
31
+ validatedVersion = true ;
32
+ }
33
+
21
34
// Validate Keys
22
35
keys . forEach ( key => {
23
36
/**
@@ -39,6 +52,7 @@ function validateNamespace(definition, candidate) {
39
52
const returnKeys = Object . keys ( definitionChunk ) . filter (
40
53
iKey => ~ iKey . indexOf ( '__return' )
41
54
) ;
55
+
42
56
describe ( `${ key } ` , function ( ) {
43
57
/**
44
58
* Tests of the actual API
Original file line number Diff line number Diff line change 15
15
*/
16
16
17
17
const gulp = require ( 'gulp' ) ;
18
+ const { resolve } = require ( 'path' ) ;
19
+ const replace = require ( 'gulp-replace' ) ;
20
+ const sourcemaps = require ( 'gulp-sourcemaps' ) ;
18
21
const tools = require ( '../../tools/build' ) ;
19
22
20
- const buildModule = gulp . parallel ( [
21
- tools . buildCjs ( __dirname ) ,
22
- tools . buildEsm ( __dirname )
23
- ] ) ;
23
+ function postProcess ( ) {
24
+ return gulp
25
+ . src ( resolve ( __dirname , 'dist/**/*.js' ) , { base : '.' } )
26
+ . pipe ( sourcemaps . init ( { loadMaps : true } ) )
27
+ . pipe (
28
+ replace ( '${JSCORE_VERSION}' , require ( '../firebase/package.json' ) . version )
29
+ )
30
+ . pipe ( sourcemaps . write ( '.' ) )
31
+ . pipe ( gulp . dest ( '.' ) ) ;
32
+ }
33
+
34
+ const buildModule = gulp . series (
35
+ gulp . parallel ( [ tools . buildCjs ( __dirname ) , tools . buildEsm ( __dirname ) ] ) ,
36
+ postProcess
37
+ ) ;
24
38
25
39
const setupWatcher = ( ) => {
26
40
gulp . watch ( 'src/**/*' , buildModule ) ;
Original file line number Diff line number Diff line change 21
21
"@types/sinon" : " ^2.3.3" ,
22
22
"chai" : " ^4.1.1" ,
23
23
"gulp" : " gulpjs/gulp#4.0" ,
24
+ "gulp-replace" : " ^0.6.1" ,
25
+ "gulp-sourcemaps" : " ^2.6.1" ,
24
26
"karma" : " ^1.7.0" ,
25
27
"karma-chrome-launcher" : " ^2.2.0" ,
26
28
"karma-cli" : " ^1.0.1" ,
You can’t perform that action at this time.
0 commit comments