mirror of
				https://github.com/NativeScript/NativeScript.git
				synced 2025-11-04 21:06:45 +08:00 
			
		
		
		
	fix: ensure Application instance initialized early (#10315)
This commit is contained in:
		@ -370,3 +370,6 @@ function isTestingEnv() {
 | 
				
			|||||||
if (!global.NativeScriptHasInitGlobal && !isTestingEnv()) {
 | 
					if (!global.NativeScriptHasInitGlobal && !isTestingEnv()) {
 | 
				
			||||||
	initGlobal();
 | 
						initGlobal();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ensure the Application instance is initialized before any other module imports it.
 | 
				
			||||||
 | 
					require('@nativescript/core/application');
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,7 @@
 | 
				
			|||||||
// @ts-nocheck
 | 
					// @ts-nocheck
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jest.mock('@nativescript/core/application', () => null, { virtual: true });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
global.__DEV__ = true;
 | 
					global.__DEV__ = true;
 | 
				
			||||||
global.WeakRef.prototype.get = global.WeakRef.prototype.deref;
 | 
					global.WeakRef.prototype.get = global.WeakRef.prototype.deref;
 | 
				
			||||||
global.NativeClass = function () {};
 | 
					global.NativeClass = function () {};
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user