@atlaspack/runtime-js 2.14.5-canary.104 → 2.14.5-canary.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/runtime-js",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.106+331ec53a7",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"node": ">= 16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
19
|
-
"@atlaspack/domain-sharding": "2.14.1-canary.
|
|
20
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
21
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
22
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
18
|
+
"@atlaspack/diagnostic": "2.14.1-canary.174+331ec53a7",
|
|
19
|
+
"@atlaspack/domain-sharding": "2.14.1-canary.174+331ec53a7",
|
|
20
|
+
"@atlaspack/feature-flags": "2.14.1-canary.174+331ec53a7",
|
|
21
|
+
"@atlaspack/plugin": "2.14.5-canary.106+331ec53a7",
|
|
22
|
+
"@atlaspack/utils": "2.14.5-canary.106+331ec53a7",
|
|
23
23
|
"nullthrows": "^1.1.1"
|
|
24
24
|
},
|
|
25
25
|
"type": "commonjs",
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "331ec53a7eeeafaf834dd1a171e44c3f0091508e"
|
|
27
27
|
}
|
package/test/analytics.test.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {sendAnalyticsEvent} from '../src/helpers/browser/analytics/analytics.js';
|
|
2
2
|
import {mock} from 'node:test';
|
|
3
|
+
|
|
3
4
|
import type {Mock} from 'node:test';
|
|
4
5
|
import assert from 'node:assert';
|
|
5
6
|
|
|
@@ -7,7 +8,7 @@ describe('@atlaspack/analytics', () => {
|
|
|
7
8
|
let dispatchEventMock: Mock<Window['dispatchEvent']>;
|
|
8
9
|
|
|
9
10
|
beforeEach(() => {
|
|
10
|
-
// @ts-expect-error
|
|
11
|
+
// @ts-expect-error - Mocking CustomEvent for testing
|
|
11
12
|
globalThis.CustomEvent = MockCustomEvent;
|
|
12
13
|
dispatchEventMock = mock.fn();
|
|
13
14
|
globalThis.dispatchEvent = dispatchEventMock;
|
|
@@ -38,8 +39,10 @@ describe('@atlaspack/analytics', () => {
|
|
|
38
39
|
|
|
39
40
|
class MockCustomEvent {
|
|
40
41
|
eventName: string;
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
43
|
detail: any;
|
|
42
44
|
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
46
|
constructor(eventName: string, options: any = {}) {
|
|
44
47
|
this.eventName = eventName;
|
|
45
48
|
this.detail = options.detail;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
// @flow strict-local
|
|
2
|
-
|
|
3
1
|
import load from '../src/helpers/browser/esm-js-loader-retry.js';
|
|
4
2
|
import bundleManifest from '../src/helpers/bundle-manifest.js';
|
|
5
3
|
import {mock} from 'node:test';
|
|
6
4
|
import type {Mock} from 'node:test';
|
|
7
5
|
import assert from 'node:assert';
|
|
8
6
|
|
|
9
|
-
declare var globalThis: Window & {[key: string]: any};
|
|
10
|
-
|
|
11
7
|
describe('esm-js-loader-retry', () => {
|
|
12
8
|
let mockSetTimeout: Mock<Window['setTimeout']>;
|
|
13
9
|
let mockParcelImport: Mock<() => Promise<void>>;
|
|
@@ -22,16 +18,18 @@ describe('esm-js-loader-retry', () => {
|
|
|
22
18
|
});
|
|
23
19
|
|
|
24
20
|
beforeEach(() => {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
25
22
|
mockSetTimeout = mock.fn((callback: any, duration: any, ...args: any[]) =>
|
|
26
23
|
callback(),
|
|
27
24
|
);
|
|
28
|
-
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
+
globalThis.setTimeout = mockSetTimeout as any;
|
|
29
27
|
|
|
30
28
|
mockParcelImport = mock.fn(() => Promise.resolve());
|
|
31
29
|
globalThis.__parcel__import__ = mockParcelImport;
|
|
32
30
|
|
|
33
31
|
globalThis.parcelRequire = mock.fn();
|
|
34
|
-
// @ts-expect-error
|
|
32
|
+
// @ts-expect-error - Mocking navigator for testing
|
|
35
33
|
globalThis.navigator = {onLine: true};
|
|
36
34
|
globalThis.CustomEvent = globalThis.CustomEvent || class {};
|
|
37
35
|
globalThis.dispatchEvent = mock.fn();
|