Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0401b09

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

File tree

Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed

‎packages/core/globals/index.ts

Copy file name to clipboardExpand all lines: packages/core/globals/index.ts
+3Lines 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

Copy file name to clipboardExpand all lines: packages/core/jest.setup.ts
+3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.