File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1157,6 +1157,10 @@ class Encore {
1157
1157
return this ;
1158
1158
}
1159
1159
1160
+ isRuntimeConfigured ( ) {
1161
+ return runtimeConfig !== null ;
1162
+ }
1163
+
1160
1164
/**
1161
1165
* Clear the runtime environment.
1162
1166
*
@@ -1213,6 +1217,7 @@ const EncoreProxy = new Proxy(new Encore(), {
1213
1217
const safeMethods = [
1214
1218
'configureRuntimeEnvironment' ,
1215
1219
'clearRuntimeEnvironment' ,
1220
+ 'isRuntimeConfigured' ,
1216
1221
] ;
1217
1222
1218
1223
if ( ! webpackConfig && ( safeMethods . indexOf ( prop ) === - 1 ) ) {
Original file line number Diff line number Diff line change @@ -414,6 +414,22 @@ describe('Public API', () => {
414
414
415
415
} ) ;
416
416
417
+ describe ( 'isRuntimeConfigured' , ( ) => {
418
+
419
+ it ( 'should return true if the runtime environment has been configured' , ( ) => {
420
+ const returnedValue = api . isRuntimeConfigured ( ) ;
421
+ expect ( returnedValue ) . to . be . true ;
422
+ } ) ;
423
+
424
+ it ( 'should return false if the runtime environment has not been configured' , ( ) => {
425
+ api . clearRuntimeEnvironment ( ) ;
426
+
427
+ const returnedValue = api . isRuntimeConfigured ( ) ;
428
+ expect ( returnedValue ) . to . be . false ;
429
+ } ) ;
430
+
431
+ } ) ;
432
+
417
433
describe ( 'Runtime environment proxy' , ( ) => {
418
434
beforeEach ( ( ) => {
419
435
api . clearRuntimeEnvironment ( ) ;
You can’t perform that action at this time.
0 commit comments