@quake2ts/test-utils 0.0.850 → 0.0.852
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/dist/index.cjs +7 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/setup/webgpu.ts +16 -8
package/dist/index.cjs
CHANGED
|
@@ -281,6 +281,7 @@ __export(index_exports, {
|
|
|
281
281
|
savePNG: () => savePNG,
|
|
282
282
|
serializeUserInfo: () => serializeUserInfo,
|
|
283
283
|
setupBrowserEnvironment: () => setupBrowserEnvironment,
|
|
284
|
+
setupHeadlessWebGPUEnv: () => setupHeadlessWebGPUEnv,
|
|
284
285
|
setupMockAudioContext: () => setupMockAudioContext,
|
|
285
286
|
setupNodeEnvironment: () => setupNodeEnvironment,
|
|
286
287
|
setupWebGPUMocks: () => setupWebGPUMocks,
|
|
@@ -3198,9 +3199,9 @@ function createMockImage(width = 100, height = 100, src = "") {
|
|
|
3198
3199
|
}
|
|
3199
3200
|
|
|
3200
3201
|
// src/setup/webgpu.ts
|
|
3201
|
-
async function
|
|
3202
|
+
async function setupHeadlessWebGPUEnv() {
|
|
3202
3203
|
if (typeof process === "undefined" || process.release?.name !== "node") {
|
|
3203
|
-
throw new Error("
|
|
3204
|
+
throw new Error("setupHeadlessWebGPUEnv should only be called in a Node.js environment");
|
|
3204
3205
|
}
|
|
3205
3206
|
let create, globals2;
|
|
3206
3207
|
try {
|
|
@@ -3227,6 +3228,9 @@ async function initHeadlessWebGPU(options) {
|
|
|
3227
3228
|
}
|
|
3228
3229
|
Object.assign(globalThis, globals2);
|
|
3229
3230
|
}
|
|
3231
|
+
}
|
|
3232
|
+
async function initHeadlessWebGPU(options) {
|
|
3233
|
+
await setupHeadlessWebGPUEnv();
|
|
3230
3234
|
const adapter = await navigator.gpu.requestAdapter({
|
|
3231
3235
|
powerPreference: options?.powerPreference || "high-performance"
|
|
3232
3236
|
});
|
|
@@ -6828,6 +6832,7 @@ function createVisualTestScenario(sceneName) {
|
|
|
6828
6832
|
savePNG,
|
|
6829
6833
|
serializeUserInfo,
|
|
6830
6834
|
setupBrowserEnvironment,
|
|
6835
|
+
setupHeadlessWebGPUEnv,
|
|
6831
6836
|
setupMockAudioContext,
|
|
6832
6837
|
setupNodeEnvironment,
|
|
6833
6838
|
setupWebGPUMocks,
|