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 1414 * limitations under the License.
1515 */
1616
17+ let validatedVersion = false ;
18+
1719function validateNamespace ( definition , candidate ) {
1820 const __expect = require ( 'chai' ) . expect ;
1921 const keys = Object . keys ( definition ) . filter ( key => ! ~ key . indexOf ( '__' ) ) ;
2022
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+
2134 // Validate Keys
2235 keys . forEach ( key => {
2336 /**
@@ -39,6 +52,7 @@ function validateNamespace(definition, candidate) {
3952 const returnKeys = Object . keys ( definitionChunk ) . filter (
4053 iKey => ~ iKey . indexOf ( '__return' )
4154 ) ;
55+
4256 describe ( `${ key } ` , function ( ) {
4357 /**
4458 * Tests of the actual API
Original file line number Diff line number Diff line change 1515 */
1616
1717const gulp = require ( 'gulp' ) ;
18+ const { resolve } = require ( 'path' ) ;
19+ const replace = require ( 'gulp-replace' ) ;
20+ const sourcemaps = require ( 'gulp-sourcemaps' ) ;
1821const tools = require ( '../../tools/build' ) ;
1922
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+ ) ;
2438
2539const setupWatcher = ( ) => {
2640 gulp . watch ( 'src/**/*' , buildModule ) ;
Original file line number Diff line number Diff line change 2121 "@types/sinon" : " ^2.3.3" ,
2222 "chai" : " ^4.1.1" ,
2323 "gulp" : " gulpjs/gulp#4.0" ,
24+ "gulp-replace" : " ^0.6.1" ,
25+ "gulp-sourcemaps" : " ^2.6.1" ,
2426 "karma" : " ^1.7.0" ,
2527 "karma-chrome-launcher" : " ^2.2.0" ,
2628 "karma-cli" : " ^1.0.1" ,
You can’t perform that action at this time.
0 commit comments