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 {
11571157 return this ;
11581158 }
11591159
1160+ isRuntimeEnvironmentConfigured ( ) {
1161+ return runtimeConfig !== null ;
1162+ }
1163+
11601164 /**
11611165 * Clear the runtime environment.
11621166 *
@@ -1213,6 +1217,7 @@ const EncoreProxy = new Proxy(new Encore(), {
12131217 const safeMethods = [
12141218 'configureRuntimeEnvironment' ,
12151219 'clearRuntimeEnvironment' ,
1220+ 'isRuntimeEnvironmentConfigured' ,
12161221 ] ;
12171222
12181223 if ( ! webpackConfig && ( safeMethods . indexOf ( prop ) === - 1 ) ) {
Original file line number Diff line number Diff line change @@ -414,6 +414,22 @@ describe('Public API', () => {
414414
415415 } ) ;
416416
417+ describe ( 'isRuntimeEnvironmentConfigured' , ( ) => {
418+
419+ it ( 'should return true if the runtime environment has been configured' , ( ) => {
420+ const returnedValue = api . isRuntimeEnvironmentConfigured ( ) ;
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 . isRuntimeEnvironmentConfigured ( ) ;
428+ expect ( returnedValue ) . to . be . false ;
429+ } ) ;
430+
431+ } ) ;
432+
417433 describe ( 'Runtime environment proxy' , ( ) => {
418434 beforeEach ( ( ) => {
419435 api . clearRuntimeEnvironment ( ) ;
You can’t perform that action at this time.
0 commit comments