Skip to content

Commit 0401b09

Browse files
authored
fix: ensure Application instance initialized early (#10315)
1 parent e430555 commit 0401b09

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/core/globals/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,6 @@ function isTestingEnv() {
370370
if (!global.NativeScriptHasInitGlobal && !isTestingEnv()) {
371371
initGlobal();
372372
}
373+
374+
// ensure the Application instance is initialized before any other module imports it.
375+
require('@nativescript/core/application');

packages/core/jest.setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// @ts-nocheck
2+
3+
jest.mock('@nativescript/core/application', () => null, { virtual: true });
4+
25
global.__DEV__ = true;
36
global.WeakRef.prototype.get = global.WeakRef.prototype.deref;
47
global.NativeClass = function () {};

0 commit comments

Comments
 (0)