@@ -32,6 +32,13 @@ describe('config()', () => {
3232 unsetSingleton ( ) ;
3333 } ) ;
3434
35+ it ( 'loads config values from .runtimeconfig.json' , ( ) => {
36+ mockRequire ( '../../../.runtimeconfig.json' , { foo : 'bar' , firebase : { } } ) ;
37+ let loaded = config ( ) ;
38+ expect ( loaded ) . to . have . property ( 'firebase' ) ;
39+ expect ( loaded ) . to . have . property ( 'foo' , 'bar' ) ;
40+ } ) ;
41+
3542 it ( 'loads config values from config.json' , ( ) => {
3643 mockRequire ( '../../../config.json' , { foo : 'bar' , firebase : { } } ) ;
3744 let loaded = config ( ) ;
@@ -40,17 +47,17 @@ describe('config()', () => {
4047 } ) ;
4148
4249 it ( 'injects a Firebase credential' , ( ) => {
43- mockRequire ( '../../../config .json' , { firebase : { } } ) ;
50+ mockRequire ( '../../../.runtimeconfig .json' , { firebase : { } } ) ;
4451 expect ( config ( ) ) . to . deep . property ( 'firebase.credential' ) ;
4552 } ) ;
4653
4754 it ( 'throws an error if config.json not present' , ( ) => {
48- mockRequire ( '../../../config .json' , 'does-not-exist' ) ;
55+ mockRequire ( '../../../.runtimeconfig .json' , 'does-not-exist' ) ;
4956 expect ( config ) . to . throw ( 'not available' ) ;
5057 } ) ;
5158
5259 it ( 'throws an error if Firebase configs not present' , ( ) => {
53- mockRequire ( '../../../config .json' , { } ) ;
60+ mockRequire ( '../../../.runtimeconfig .json' , { } ) ;
5461 expect ( config ) . to . throw ( 'Firebase config variables are missing.' ) ;
5562 } ) ;
5663} ) ;
0 commit comments