@flighthq/application-gl 0.3.0-next.1220.6982c21 → 0.3.0-next.1248.f867198
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": "@flighthq/application-gl",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.1248.f867198",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/flighthq/flight.git",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flighthq/application": "0.3.0-next.
|
|
40
|
-
"@flighthq/node": "0.3.0-next.
|
|
41
|
-
"@flighthq/render-gl": "0.3.0-next.
|
|
42
|
-
"@flighthq/types": "0.3.0-next.
|
|
39
|
+
"@flighthq/application": "0.3.0-next.1248.f867198",
|
|
40
|
+
"@flighthq/node": "0.3.0-next.1248.f867198",
|
|
41
|
+
"@flighthq/render-gl": "0.3.0-next.1248.f867198",
|
|
42
|
+
"@flighthq/types": "0.3.0-next.1248.f867198"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@flighthq/signals": "*",
|
|
@@ -6,7 +6,29 @@ import {
|
|
|
6
6
|
import { emitSignal } from '@flighthq/signals/contract';
|
|
7
7
|
import type { GlRenderState, GlRenderTarget } from '@flighthq/types/contract';
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import type * as GlapplicationrenderviewModule from './glApplicationRenderView';
|
|
10
|
+
|
|
11
|
+
// Mocked per file with doMock plus dynamic imports of the subject, not top-level hoisted vi.mock.
|
|
12
|
+
// The suite runs isolate:false over a shared module registry, so a hoisted mock is registered for
|
|
13
|
+
// every file in the worker rather than this one -- see the rule in the root vitest config.
|
|
14
|
+
let createGlApplicationRenderView: typeof GlapplicationrenderviewModule.createGlApplicationRenderView;
|
|
15
|
+
let destroyGlApplicationRenderView: typeof GlapplicationrenderviewModule.destroyGlApplicationRenderView;
|
|
16
|
+
|
|
17
|
+
beforeAll(async () => {
|
|
18
|
+
vi.resetModules();
|
|
19
|
+
vi.doMock('@flighthq/node/contract', () => ({
|
|
20
|
+
createViewport: mocks.createViewport,
|
|
21
|
+
}));
|
|
22
|
+
vi.doMock('@flighthq/render-gl/contract', () => ({
|
|
23
|
+
createGlRenderState: mocks.createGlRenderState,
|
|
24
|
+
createGlRenderTarget: mocks.createGlRenderTarget,
|
|
25
|
+
destroyGlRenderState: mocks.destroyGlRenderState,
|
|
26
|
+
destroyGlRenderTarget: mocks.destroyGlRenderTarget,
|
|
27
|
+
invalidateGlRenderStateCache: mocks.invalidateGlRenderStateCache,
|
|
28
|
+
resizeGlRenderTarget: mocks.resizeGlRenderTarget,
|
|
29
|
+
}));
|
|
30
|
+
({ createGlApplicationRenderView, destroyGlApplicationRenderView } = await import('./glApplicationRenderView'));
|
|
31
|
+
});
|
|
10
32
|
|
|
11
33
|
const mocks = vi.hoisted(() => ({
|
|
12
34
|
createGlRenderState: vi.fn(),
|
|
@@ -18,19 +40,6 @@ const mocks = vi.hoisted(() => ({
|
|
|
18
40
|
resizeGlRenderTarget: vi.fn(),
|
|
19
41
|
}));
|
|
20
42
|
|
|
21
|
-
vi.mock('@flighthq/node/contract', () => ({
|
|
22
|
-
createViewport: mocks.createViewport,
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
vi.mock('@flighthq/render-gl/contract', () => ({
|
|
26
|
-
createGlRenderState: mocks.createGlRenderState,
|
|
27
|
-
createGlRenderTarget: mocks.createGlRenderTarget,
|
|
28
|
-
destroyGlRenderState: mocks.destroyGlRenderState,
|
|
29
|
-
destroyGlRenderTarget: mocks.destroyGlRenderTarget,
|
|
30
|
-
invalidateGlRenderStateCache: mocks.invalidateGlRenderStateCache,
|
|
31
|
-
resizeGlRenderTarget: mocks.resizeGlRenderTarget,
|
|
32
|
-
}));
|
|
33
|
-
|
|
34
43
|
beforeEach(() => {
|
|
35
44
|
mocks.createGlRenderState.mockImplementation((canvas: HTMLCanvasElement, options: { pixelRatio: number }) => ({
|
|
36
45
|
canvas,
|