From d6645e7e70383a3726f75d15f5081f453664e561 Mon Sep 17 00:00:00 2001 From: Iwo Plaza Date: Fri, 13 Mar 2026 19:04:10 +0100 Subject: [PATCH 1/2] chore: Move individual example tests to `apps/typegpu-docs` --- apps/typegpu-docs/package.json | 1 + .../individual-example-tests}/3d-fish.test.ts | 6 ++--- .../ascii-filter.test.ts | 4 +-- .../individual-example-tests}/blur.test.ts | 6 ++--- .../individual-example-tests}/boids.test.ts | 4 +-- .../box-raytracing.test.ts | 4 +-- .../camera-thresholding.test.ts | 4 +-- .../caustics.test.ts | 4 +-- .../chroma-keying.test.ts | 4 +-- .../individual-example-tests}/clouds.test.ts | 6 ++--- .../confetti.test.ts | 4 +-- .../copy-error.test.ts | 4 +-- .../cubemap-reflection.test.ts | 6 ++--- .../individual-example-tests}/disco.test.ts | 4 +-- .../dispatch.test.ts | 4 +-- .../fluid-double-buffering.test.ts | 4 +-- .../fluid-with-atomics.test.ts | 4 +-- .../function-visualizer.test.ts | 6 ++--- .../game-of-life.test.ts | 4 +-- .../gradient-tiles.test.ts | 4 +-- .../individual-example-tests}/gravity.test.ts | 6 ++--- .../image-tuning.test.ts | 6 ++--- .../increment.test.ts | 4 +-- .../jelly-slider.test.ts | 6 ++--- .../jelly-switch.test.ts | 6 ++--- .../jump-flood-distance.test.ts | 6 ++--- .../jump-flood-voronoi.test.ts | 6 ++--- .../liquid-glass.test.ts | 6 ++--- .../log-test.test.ts | 4 +-- .../matrix-multiplication.test.ts | 4 +-- .../matrix-next.test.ts | 4 +-- .../mnist-inference.test.ts | 6 ++--- .../individual-example-tests}/oklab.test.ts | 4 +-- .../perlin-noise.test.ts | 4 +-- .../phong-reflection.test.ts | 6 ++--- .../point-light-shadow.test.ts | 6 ++--- .../probability.test.ts | 4 +-- .../ray-marching.test.ts | 4 +-- .../ripple-cube.test.ts | 6 ++--- .../simple-shadow.test.ts | 6 ++--- .../slime-mold-3d.test.ts | 4 +-- .../slime-mold.test.ts | 4 +-- .../smoky-triangle.test.ts | 4 +-- .../individual-example-tests}/square.test.ts | 4 +-- .../stable-fluid.test.ts | 6 ++--- .../individual-example-tests}/stencil.test.ts | 6 ++--- .../tgsl-parsing-test.test.ts | 4 +-- .../triangle-next.test.ts | 4 +-- .../triangle.test.ts | 4 +-- .../two-boxes.test.ts | 6 ++--- .../uniformity.test.ts | 6 ++--- .../utils/baseTest.ts | 0 .../utils/commonMocks.ts | 0 .../utils/testUtils.ts | 0 .../vaporrave.test.ts | 4 +-- .../wgsl-resolution.test.ts | 4 +-- .../xor-dev-centrifuge-2.test.ts | 4 +-- .../xor-dev-runner.test.ts | 6 ++--- apps/typegpu-docs/vitest.config.mts | 25 ++++++++++++++----- packages/typegpu-testing-utility/package.json | 23 +++++++++++++++++ .../src}/extendedIt.ts | 8 +++--- packages/typegpu-testing-utility/src/index.ts | 1 + .../src}/webgpuGlobals.ts | 0 .../typegpu-testing-utility/tsconfig.json | 3 +++ packages/typegpu/package.json | 1 + packages/typegpu/tests/accessor.test.ts | 2 +- .../typegpu/tests/bindGroupLayout.test.ts | 4 +-- packages/typegpu/tests/buffer.test.ts | 2 +- .../typegpu/tests/bufferShorthands.test.ts | 2 +- packages/typegpu/tests/bufferUsage.test.ts | 2 +- packages/typegpu/tests/compiledIO.test.ts | 2 +- .../typegpu/tests/computePipeline.test.ts | 2 +- packages/typegpu/tests/disarray.test.ts | 2 +- packages/typegpu/tests/gpuValueOf.test.ts | 2 +- .../tests/guardedComputePipeline.test.ts | 2 +- packages/typegpu/tests/lazy.test.ts | 2 +- packages/typegpu/tests/limitsOverflow.test.ts | 2 +- packages/typegpu/tests/namespace.test.ts | 2 +- packages/typegpu/tests/partialIo.test.ts | 2 +- .../typegpu/tests/pipeline-resolution.test.ts | 2 +- packages/typegpu/tests/querySet.test.ts | 2 +- packages/typegpu/tests/ref.test.ts | 2 +- packages/typegpu/tests/renderPipeline.test.ts | 2 +- packages/typegpu/tests/resolve.test.ts | 2 +- packages/typegpu/tests/root.test.ts | 2 +- packages/typegpu/tests/simulate.test.ts | 2 +- packages/typegpu/tests/slot.test.ts | 2 +- .../typegpu/tests/std/numeric/frexp.test.ts | 2 +- .../typegpu/tests/std/numeric/modf.test.ts | 2 +- .../tests/std/texture/textureGather.test.ts | 2 +- .../tests/std/texture/textureLoad.test.ts | 2 +- .../tests/std/texture/textureSample.test.ts | 2 +- packages/typegpu/tests/texture.test.ts | 4 +-- packages/typegpu/tests/tgpuGenericFn.test.ts | 2 +- .../typegpu/tests/tgsl/argumentOrigin.test.ts | 2 +- .../typegpu/tests/tgsl/assignment.test.ts | 2 +- packages/typegpu/tests/tgsl/codeGen.test.ts | 2 +- packages/typegpu/tests/tgsl/comptime.test.ts | 2 +- .../typegpu/tests/tgsl/consoleLog.test.ts | 2 +- .../typegpu/tests/tgsl/conversion.test.ts | 2 +- .../tests/tgsl/extensionEnabled.test.ts | 2 +- .../typegpu/tests/tgsl/infixOperators.test.ts | 2 +- .../typegpu/tests/tgsl/memberAccess.test.ts | 2 +- .../typegpu/tests/tgsl/nameClashes.test.ts | 2 +- .../tests/tgsl/operatorOverloads.test.ts | 2 +- .../typegpu/tests/tgsl/rawCodeSnippet.test.ts | 2 +- packages/typegpu/tests/tgsl/shellless.test.ts | 2 +- .../tests/tgsl/ternaryOperator.test.ts | 2 +- .../typegpu/tests/tgsl/wgslGenerator.test.ts | 2 +- packages/typegpu/tests/tgslFn.test.ts | 2 +- .../typegpu/tests/unplugin/autoname.test.ts | 2 +- packages/typegpu/tests/unroll.test.ts | 2 +- pnpm-lock.yaml | 16 ++++++++++++ 113 files changed, 246 insertions(+), 190 deletions(-) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/3d-fish.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/ascii-filter.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/blur.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/boids.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/box-raytracing.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/camera-thresholding.test.ts (94%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/caustics.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/chroma-keying.test.ts (94%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/clouds.test.ts (96%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/confetti.test.ts (95%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/copy-error.test.ts (87%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/cubemap-reflection.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/disco.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/dispatch.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/fluid-double-buffering.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/fluid-with-atomics.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/function-visualizer.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/game-of-life.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/gradient-tiles.test.ts (92%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/gravity.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/image-tuning.test.ts (95%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/increment.test.ts (89%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/jelly-slider.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/jelly-switch.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/jump-flood-distance.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/jump-flood-voronoi.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/liquid-glass.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/log-test.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/matrix-multiplication.test.ts (93%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/matrix-next.test.ts (96%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/mnist-inference.test.ts (94%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/oklab.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/perlin-noise.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/phong-reflection.test.ts (95%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/point-light-shadow.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/probability.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/ray-marching.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/ripple-cube.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/simple-shadow.test.ts (96%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/slime-mold-3d.test.ts (99%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/slime-mold.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/smoky-triangle.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/square.test.ts (90%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/stable-fluid.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/stencil.test.ts (92%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/tgsl-parsing-test.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/triangle-next.test.ts (92%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/triangle.test.ts (92%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/two-boxes.test.ts (88%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/uniformity.test.ts (94%) rename {packages/typegpu/tests/examples => apps/typegpu-docs/tests/individual-example-tests}/utils/baseTest.ts (100%) rename {packages/typegpu/tests/examples => apps/typegpu-docs/tests/individual-example-tests}/utils/commonMocks.ts (100%) rename {packages/typegpu/tests/examples => apps/typegpu-docs/tests/individual-example-tests}/utils/testUtils.ts (100%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/vaporrave.test.ts (98%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/wgsl-resolution.test.ts (97%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/xor-dev-centrifuge-2.test.ts (95%) rename {packages/typegpu/tests/examples/individual => apps/typegpu-docs/tests/individual-example-tests}/xor-dev-runner.test.ts (94%) create mode 100644 packages/typegpu-testing-utility/package.json rename packages/{typegpu/tests/utils => typegpu-testing-utility/src}/extendedIt.ts (96%) create mode 100644 packages/typegpu-testing-utility/src/index.ts rename packages/{typegpu/tests/utils => typegpu-testing-utility/src}/webgpuGlobals.ts (100%) create mode 100644 packages/typegpu-testing-utility/tsconfig.json diff --git a/apps/typegpu-docs/package.json b/apps/typegpu-docs/package.json index 2307fa9398..cbdfd69c0d 100644 --- a/apps/typegpu-docs/package.json +++ b/apps/typegpu-docs/package.json @@ -83,6 +83,7 @@ "magic-string": "^0.30.21", "tailwindcss": "^4.1.11", "tailwindcss-motion": "^1.1.1", + "typegpu-testing-utility": "workspace:*", "vite-imagetools": "catalog:frontend", "vite-plugin-wasm": "^3.5.0", "yaml": "^2.8.1" diff --git a/packages/typegpu/tests/examples/individual/3d-fish.test.ts b/apps/typegpu-docs/tests/individual-example-tests/3d-fish.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/3d-fish.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/3d-fish.test.ts index 1cb047238b..79f39450a7 100644 --- a/packages/typegpu/tests/examples/individual/3d-fish.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/3d-fish.test.ts @@ -3,13 +3,13 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; import { mock3DModelLoading, mockCreateImageBitmap, mockResizeObserver, -} from '../utils/commonMocks.ts'; +} from './utils/commonMocks.ts'; describe('3d fish example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/ascii-filter.test.ts b/apps/typegpu-docs/tests/individual-example-tests/ascii-filter.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/ascii-filter.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/ascii-filter.test.ts index 63fa3626f0..d472e36d6c 100644 --- a/packages/typegpu/tests/examples/individual/ascii-filter.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/ascii-filter.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('ascii filter example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/blur.test.ts b/apps/typegpu-docs/tests/individual-example-tests/blur.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/blur.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/blur.test.ts index 4a18b74895..61d8b5a848 100644 --- a/packages/typegpu/tests/examples/individual/blur.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/blur.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockCreateImageBitmap, mockImageLoading } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockCreateImageBitmap, mockImageLoading } from './utils/commonMocks.ts'; describe('blur example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/boids.test.ts b/apps/typegpu-docs/tests/individual-example-tests/boids.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/boids.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/boids.test.ts index 0474eea95c..321ca08bf6 100644 --- a/packages/typegpu/tests/examples/individual/boids.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/boids.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('boids example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/box-raytracing.test.ts b/apps/typegpu-docs/tests/individual-example-tests/box-raytracing.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/box-raytracing.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/box-raytracing.test.ts index 6da5eace2f..7a268c4ab9 100644 --- a/packages/typegpu/tests/examples/individual/box-raytracing.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/box-raytracing.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('box raytracing example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/camera-thresholding.test.ts b/apps/typegpu-docs/tests/individual-example-tests/camera-thresholding.test.ts similarity index 94% rename from packages/typegpu/tests/examples/individual/camera-thresholding.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/camera-thresholding.test.ts index 1eb4179509..bf7dd98b5c 100644 --- a/packages/typegpu/tests/examples/individual/camera-thresholding.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/camera-thresholding.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('camera thresholding example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/caustics.test.ts b/apps/typegpu-docs/tests/individual-example-tests/caustics.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/caustics.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/caustics.test.ts index 08091caef4..e675da874b 100644 --- a/packages/typegpu/tests/examples/individual/caustics.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/caustics.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('caustics example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/chroma-keying.test.ts b/apps/typegpu-docs/tests/individual-example-tests/chroma-keying.test.ts similarity index 94% rename from packages/typegpu/tests/examples/individual/chroma-keying.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/chroma-keying.test.ts index 74bb5ff226..5869e0182f 100644 --- a/packages/typegpu/tests/examples/individual/chroma-keying.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/chroma-keying.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('chroma keying example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/clouds.test.ts b/apps/typegpu-docs/tests/individual-example-tests/clouds.test.ts similarity index 96% rename from packages/typegpu/tests/examples/individual/clouds.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/clouds.test.ts index 80964d7786..c0d9f869a1 100644 --- a/packages/typegpu/tests/examples/individual/clouds.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/clouds.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('clouds example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/confetti.test.ts b/apps/typegpu-docs/tests/individual-example-tests/confetti.test.ts similarity index 95% rename from packages/typegpu/tests/examples/individual/confetti.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/confetti.test.ts index c686808a73..2414ceaf95 100644 --- a/packages/typegpu/tests/examples/individual/confetti.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/confetti.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('confetti example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/copy-error.test.ts b/apps/typegpu-docs/tests/individual-example-tests/copy-error.test.ts similarity index 87% rename from packages/typegpu/tests/examples/individual/copy-error.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/copy-error.test.ts index af2f1be6a0..7e34e38820 100644 --- a/packages/typegpu/tests/examples/individual/copy-error.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/copy-error.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('copy error example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/cubemap-reflection.test.ts b/apps/typegpu-docs/tests/individual-example-tests/cubemap-reflection.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/cubemap-reflection.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/cubemap-reflection.test.ts index bdc7d98f64..7f53569e53 100644 --- a/packages/typegpu/tests/examples/individual/cubemap-reflection.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/cubemap-reflection.test.ts @@ -3,13 +3,13 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; import { mockCreateImageBitmap, mockImageLoading, mockResizeObserver, -} from '../utils/commonMocks.ts'; +} from './utils/commonMocks.ts'; describe('cubemap reflection example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/disco.test.ts b/apps/typegpu-docs/tests/individual-example-tests/disco.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/disco.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/disco.test.ts index 5cc750d4a6..213c3f2f07 100644 --- a/packages/typegpu/tests/examples/individual/disco.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/disco.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('disco example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/dispatch.test.ts b/apps/typegpu-docs/tests/individual-example-tests/dispatch.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/dispatch.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/dispatch.test.ts index 75c9f0210a..d1d9573ccf 100644 --- a/packages/typegpu/tests/examples/individual/dispatch.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/dispatch.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('tgsl parsing test example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/fluid-double-buffering.test.ts b/apps/typegpu-docs/tests/individual-example-tests/fluid-double-buffering.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/fluid-double-buffering.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/fluid-double-buffering.test.ts index 4ca716bdba..d941f9753c 100644 --- a/packages/typegpu/tests/examples/individual/fluid-double-buffering.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/fluid-double-buffering.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('fluid double buffering example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/fluid-with-atomics.test.ts b/apps/typegpu-docs/tests/individual-example-tests/fluid-with-atomics.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/fluid-with-atomics.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/fluid-with-atomics.test.ts index 4c79eb55fc..ed7abce05e 100644 --- a/packages/typegpu/tests/examples/individual/fluid-with-atomics.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/fluid-with-atomics.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('fluid with atomics example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/function-visualizer.test.ts b/apps/typegpu-docs/tests/individual-example-tests/function-visualizer.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/function-visualizer.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/function-visualizer.test.ts index aa254f0554..a2f1e71558 100644 --- a/packages/typegpu/tests/examples/individual/function-visualizer.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/function-visualizer.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('function visualizer example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/game-of-life.test.ts b/apps/typegpu-docs/tests/individual-example-tests/game-of-life.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/game-of-life.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/game-of-life.test.ts index 5e3acfe317..e26d9527b9 100644 --- a/packages/typegpu/tests/examples/individual/game-of-life.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/game-of-life.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('game of life example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/gradient-tiles.test.ts b/apps/typegpu-docs/tests/individual-example-tests/gradient-tiles.test.ts similarity index 92% rename from packages/typegpu/tests/examples/individual/gradient-tiles.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/gradient-tiles.test.ts index 97aa85040c..a15d15f4dd 100644 --- a/packages/typegpu/tests/examples/individual/gradient-tiles.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/gradient-tiles.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('gradient tiles example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/gravity.test.ts b/apps/typegpu-docs/tests/individual-example-tests/gravity.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/gravity.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/gravity.test.ts index e92ba0827d..ee14cc36f1 100644 --- a/packages/typegpu/tests/examples/individual/gravity.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/gravity.test.ts @@ -3,14 +3,14 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; import { mock3DModelLoading, mockCreateImageBitmap, mockImageLoading, mockResizeObserver, -} from '../utils/commonMocks.ts'; +} from './utils/commonMocks.ts'; describe('gravity example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/image-tuning.test.ts b/apps/typegpu-docs/tests/individual-example-tests/image-tuning.test.ts similarity index 95% rename from packages/typegpu/tests/examples/individual/image-tuning.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/image-tuning.test.ts index 80aad8a27c..91d22ed03f 100644 --- a/packages/typegpu/tests/examples/individual/image-tuning.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/image-tuning.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockCreateImageBitmap, mockImageLoading } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockCreateImageBitmap, mockImageLoading } from './utils/commonMocks.ts'; describe('image tuning example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/increment.test.ts b/apps/typegpu-docs/tests/individual-example-tests/increment.test.ts similarity index 89% rename from packages/typegpu/tests/examples/individual/increment.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/increment.test.ts index 7713742cb9..71109cf3c5 100644 --- a/packages/typegpu/tests/examples/individual/increment.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/increment.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('increment example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/jelly-slider.test.ts b/apps/typegpu-docs/tests/individual-example-tests/jelly-slider.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/jelly-slider.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/jelly-slider.test.ts index 56908c5d6d..d07fbb0295 100644 --- a/packages/typegpu/tests/examples/individual/jelly-slider.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/jelly-slider.test.ts @@ -3,14 +3,14 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; import { mockCreateImageBitmap, mockFonts, mockImageLoading, mockResizeObserver, -} from '../utils/commonMocks.ts'; +} from './utils/commonMocks.ts'; describe('jelly-slider example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/jelly-switch.test.ts b/apps/typegpu-docs/tests/individual-example-tests/jelly-switch.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/jelly-switch.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/jelly-switch.test.ts index 1bc1427683..66806796b9 100644 --- a/packages/typegpu/tests/examples/individual/jelly-switch.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/jelly-switch.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockAudioLoading, mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockAudioLoading, mockResizeObserver } from './utils/commonMocks.ts'; describe('jelly switch example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/jump-flood-distance.test.ts b/apps/typegpu-docs/tests/individual-example-tests/jump-flood-distance.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/jump-flood-distance.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/jump-flood-distance.test.ts index 384bdd1091..94b5c64609 100644 --- a/packages/typegpu/tests/examples/individual/jump-flood-distance.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/jump-flood-distance.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('jump flood (distance) example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/jump-flood-voronoi.test.ts b/apps/typegpu-docs/tests/individual-example-tests/jump-flood-voronoi.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/jump-flood-voronoi.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/jump-flood-voronoi.test.ts index 6aa0bd27c2..fa6f83b6ab 100644 --- a/packages/typegpu/tests/examples/individual/jump-flood-voronoi.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/jump-flood-voronoi.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('jump flood (voronoi) example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/liquid-glass.test.ts b/apps/typegpu-docs/tests/individual-example-tests/liquid-glass.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/liquid-glass.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/liquid-glass.test.ts index 71da1a51e3..d9668dd9d3 100644 --- a/packages/typegpu/tests/examples/individual/liquid-glass.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/liquid-glass.test.ts @@ -3,13 +3,13 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; import { mockCreateImageBitmap, mockImageLoading, mockResizeObserver, -} from '../utils/commonMocks.ts'; +} from './utils/commonMocks.ts'; describe('liquid-glass example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/log-test.test.ts b/apps/typegpu-docs/tests/individual-example-tests/log-test.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/log-test.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/log-test.test.ts index bb5c2f9c4c..9ff1c327b9 100644 --- a/packages/typegpu/tests/examples/individual/log-test.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/log-test.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('console log example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/matrix-multiplication.test.ts b/apps/typegpu-docs/tests/individual-example-tests/matrix-multiplication.test.ts similarity index 93% rename from packages/typegpu/tests/examples/individual/matrix-multiplication.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/matrix-multiplication.test.ts index 28dc93ee8b..93b2325816 100644 --- a/packages/typegpu/tests/examples/individual/matrix-multiplication.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/matrix-multiplication.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('matrix multiplication example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/matrix-next.test.ts b/apps/typegpu-docs/tests/individual-example-tests/matrix-next.test.ts similarity index 96% rename from packages/typegpu/tests/examples/individual/matrix-next.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/matrix-next.test.ts index 65a6ea1e88..e53654c5bf 100644 --- a/packages/typegpu/tests/examples/individual/matrix-next.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/matrix-next.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('matrix(next) example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/mnist-inference.test.ts b/apps/typegpu-docs/tests/individual-example-tests/mnist-inference.test.ts similarity index 94% rename from packages/typegpu/tests/examples/individual/mnist-inference.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/mnist-inference.test.ts index 6176ef5c5e..800470a651 100644 --- a/packages/typegpu/tests/examples/individual/mnist-inference.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/mnist-inference.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockMnistWeights } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockMnistWeights } from './utils/commonMocks.ts'; describe('mnist inference example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/oklab.test.ts b/apps/typegpu-docs/tests/individual-example-tests/oklab.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/oklab.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/oklab.test.ts index 3e91ffc1b7..789e418d43 100644 --- a/packages/typegpu/tests/examples/individual/oklab.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/oklab.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('oklab example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/perlin-noise.test.ts b/apps/typegpu-docs/tests/individual-example-tests/perlin-noise.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/perlin-noise.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/perlin-noise.test.ts index d8b2736002..56f9f906e7 100644 --- a/packages/typegpu/tests/examples/individual/perlin-noise.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/perlin-noise.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('perlin noise example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/phong-reflection.test.ts b/apps/typegpu-docs/tests/individual-example-tests/phong-reflection.test.ts similarity index 95% rename from packages/typegpu/tests/examples/individual/phong-reflection.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/phong-reflection.test.ts index 05d45792f0..f9a43a7352 100644 --- a/packages/typegpu/tests/examples/individual/phong-reflection.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/phong-reflection.test.ts @@ -3,13 +3,13 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; import { mock3DModelLoading, mockCreateImageBitmap, mockResizeObserver, -} from '../utils/commonMocks.ts'; +} from './utils/commonMocks.ts'; describe('phong reflection example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/point-light-shadow.test.ts b/apps/typegpu-docs/tests/individual-example-tests/point-light-shadow.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/point-light-shadow.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/point-light-shadow.test.ts index aac4a20bce..ae2385780d 100644 --- a/packages/typegpu/tests/examples/individual/point-light-shadow.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/point-light-shadow.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('point light shadow example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/probability.test.ts b/apps/typegpu-docs/tests/individual-example-tests/probability.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/probability.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/probability.test.ts index 85034359c6..b6cab5279b 100644 --- a/packages/typegpu/tests/examples/individual/probability.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/probability.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('probability distribution plot example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/ray-marching.test.ts b/apps/typegpu-docs/tests/individual-example-tests/ray-marching.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/ray-marching.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/ray-marching.test.ts index 8545d5f0d6..5a4ff3fc1d 100644 --- a/packages/typegpu/tests/examples/individual/ray-marching.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/ray-marching.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('ray-marching example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/ripple-cube.test.ts b/apps/typegpu-docs/tests/individual-example-tests/ripple-cube.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/ripple-cube.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/ripple-cube.test.ts index 11d7e3eb12..e6978a5f06 100644 --- a/packages/typegpu/tests/examples/individual/ripple-cube.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/ripple-cube.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('ripple-cube example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/simple-shadow.test.ts b/apps/typegpu-docs/tests/individual-example-tests/simple-shadow.test.ts similarity index 96% rename from packages/typegpu/tests/examples/individual/simple-shadow.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/simple-shadow.test.ts index 12da813980..440588813a 100644 --- a/packages/typegpu/tests/examples/individual/simple-shadow.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/simple-shadow.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('simple shadow example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/slime-mold-3d.test.ts b/apps/typegpu-docs/tests/individual-example-tests/slime-mold-3d.test.ts similarity index 99% rename from packages/typegpu/tests/examples/individual/slime-mold-3d.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/slime-mold-3d.test.ts index 4f7aa3fa5a..ee1b21fa5f 100644 --- a/packages/typegpu/tests/examples/individual/slime-mold-3d.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/slime-mold-3d.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('slime mold 3d example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/slime-mold.test.ts b/apps/typegpu-docs/tests/individual-example-tests/slime-mold.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/slime-mold.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/slime-mold.test.ts index ece3d63367..b08dea74e3 100644 --- a/packages/typegpu/tests/examples/individual/slime-mold.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/slime-mold.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('slime mold example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/smoky-triangle.test.ts b/apps/typegpu-docs/tests/individual-example-tests/smoky-triangle.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/smoky-triangle.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/smoky-triangle.test.ts index c5186db085..e737f74f4b 100644 --- a/packages/typegpu/tests/examples/individual/smoky-triangle.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/smoky-triangle.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('smoky triangle', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/square.test.ts b/apps/typegpu-docs/tests/individual-example-tests/square.test.ts similarity index 90% rename from packages/typegpu/tests/examples/individual/square.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/square.test.ts index b21dba763f..c184301612 100644 --- a/packages/typegpu/tests/examples/individual/square.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/square.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('square example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/stable-fluid.test.ts b/apps/typegpu-docs/tests/individual-example-tests/stable-fluid.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/stable-fluid.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/stable-fluid.test.ts index b536101974..f20cbc50b0 100644 --- a/packages/typegpu/tests/examples/individual/stable-fluid.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/stable-fluid.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockCreateImageBitmap, mockImageLoading } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockCreateImageBitmap, mockImageLoading } from './utils/commonMocks.ts'; describe('stable-fluid example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/stencil.test.ts b/apps/typegpu-docs/tests/individual-example-tests/stencil.test.ts similarity index 92% rename from packages/typegpu/tests/examples/individual/stencil.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/stencil.test.ts index 143bfe1972..058e4d5d7c 100644 --- a/packages/typegpu/tests/examples/individual/stencil.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/stencil.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { mockResizeObserver } from './utils/commonMocks.ts'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('stencil example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/tgsl-parsing-test.test.ts b/apps/typegpu-docs/tests/individual-example-tests/tgsl-parsing-test.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/tgsl-parsing-test.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/tgsl-parsing-test.test.ts index 6c12918b9d..007436f39e 100644 --- a/packages/typegpu/tests/examples/individual/tgsl-parsing-test.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/tgsl-parsing-test.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('tgsl parsing test example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/triangle-next.test.ts b/apps/typegpu-docs/tests/individual-example-tests/triangle-next.test.ts similarity index 92% rename from packages/typegpu/tests/examples/individual/triangle-next.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/triangle-next.test.ts index 4683bde68e..78463620e4 100644 --- a/packages/typegpu/tests/examples/individual/triangle-next.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/triangle-next.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('triangle (next) example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/triangle.test.ts b/apps/typegpu-docs/tests/individual-example-tests/triangle.test.ts similarity index 92% rename from packages/typegpu/tests/examples/individual/triangle.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/triangle.test.ts index 92038cc872..e3b5829cea 100644 --- a/packages/typegpu/tests/examples/individual/triangle.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/triangle.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('triangle example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/two-boxes.test.ts b/apps/typegpu-docs/tests/individual-example-tests/two-boxes.test.ts similarity index 88% rename from packages/typegpu/tests/examples/individual/two-boxes.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/two-boxes.test.ts index b4d493169b..b98ccb0352 100644 --- a/packages/typegpu/tests/examples/individual/two-boxes.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/two-boxes.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('two boxes example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/uniformity.test.ts b/apps/typegpu-docs/tests/individual-example-tests/uniformity.test.ts similarity index 94% rename from packages/typegpu/tests/examples/individual/uniformity.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/uniformity.test.ts index 472ff18ab3..4207a132d2 100644 --- a/packages/typegpu/tests/examples/individual/uniformity.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/uniformity.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('uniformity test example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/utils/baseTest.ts b/apps/typegpu-docs/tests/individual-example-tests/utils/baseTest.ts similarity index 100% rename from packages/typegpu/tests/examples/utils/baseTest.ts rename to apps/typegpu-docs/tests/individual-example-tests/utils/baseTest.ts diff --git a/packages/typegpu/tests/examples/utils/commonMocks.ts b/apps/typegpu-docs/tests/individual-example-tests/utils/commonMocks.ts similarity index 100% rename from packages/typegpu/tests/examples/utils/commonMocks.ts rename to apps/typegpu-docs/tests/individual-example-tests/utils/commonMocks.ts diff --git a/packages/typegpu/tests/examples/utils/testUtils.ts b/apps/typegpu-docs/tests/individual-example-tests/utils/testUtils.ts similarity index 100% rename from packages/typegpu/tests/examples/utils/testUtils.ts rename to apps/typegpu-docs/tests/individual-example-tests/utils/testUtils.ts diff --git a/packages/typegpu/tests/examples/individual/vaporrave.test.ts b/apps/typegpu-docs/tests/individual-example-tests/vaporrave.test.ts similarity index 98% rename from packages/typegpu/tests/examples/individual/vaporrave.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/vaporrave.test.ts index 715ad7d881..31edd11728 100644 --- a/packages/typegpu/tests/examples/individual/vaporrave.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/vaporrave.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('vaporrave example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/wgsl-resolution.test.ts b/apps/typegpu-docs/tests/individual-example-tests/wgsl-resolution.test.ts similarity index 97% rename from packages/typegpu/tests/examples/individual/wgsl-resolution.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/wgsl-resolution.test.ts index 8542a21d45..9d81437f4e 100644 --- a/packages/typegpu/tests/examples/individual/wgsl-resolution.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/wgsl-resolution.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('wgsl resolution example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/xor-dev-centrifuge-2.test.ts b/apps/typegpu-docs/tests/individual-example-tests/xor-dev-centrifuge-2.test.ts similarity index 95% rename from packages/typegpu/tests/examples/individual/xor-dev-centrifuge-2.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/xor-dev-centrifuge-2.test.ts index fc873c8ad1..64d36cc597 100644 --- a/packages/typegpu/tests/examples/individual/xor-dev-centrifuge-2.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/xor-dev-centrifuge-2.test.ts @@ -3,8 +3,8 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; describe('xor dev centrifuge example', () => { setupCommonMocks(); diff --git a/packages/typegpu/tests/examples/individual/xor-dev-runner.test.ts b/apps/typegpu-docs/tests/individual-example-tests/xor-dev-runner.test.ts similarity index 94% rename from packages/typegpu/tests/examples/individual/xor-dev-runner.test.ts rename to apps/typegpu-docs/tests/individual-example-tests/xor-dev-runner.test.ts index 09923772c9..4c1c5b35f7 100644 --- a/packages/typegpu/tests/examples/individual/xor-dev-runner.test.ts +++ b/apps/typegpu-docs/tests/individual-example-tests/xor-dev-runner.test.ts @@ -3,9 +3,9 @@ */ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; -import { runExampleTest, setupCommonMocks } from '../utils/baseTest.ts'; -import { mockResizeObserver } from '../utils/commonMocks.ts'; +import { it } from 'typegpu-testing-utility'; +import { runExampleTest, setupCommonMocks } from './utils/baseTest.ts'; +import { mockResizeObserver } from './utils/commonMocks.ts'; describe('xor dev runner example', () => { setupCommonMocks(); diff --git a/apps/typegpu-docs/vitest.config.mts b/apps/typegpu-docs/vitest.config.mts index 5912dd4b67..5c32c37494 100644 --- a/apps/typegpu-docs/vitest.config.mts +++ b/apps/typegpu-docs/vitest.config.mts @@ -19,11 +19,24 @@ export default defineConfig({ }, }, test: { - name: 'browser', - include: ['**/*.{test,spec}.browser.ts'], - browser: { - provider: 'preview', - instances: [{ browser: 'chromium' }], - }, + projects: [ + { + test: { + name: 'browser', + include: ['**/*.{test,spec}.browser.ts'], + browser: { + provider: 'preview', + instances: [{ browser: 'chromium' }], + }, + }, + }, + { + test: { + name: 'individual-example-tests', + root: './tests/individual-example-tests', + environment: 'node', + }, + }, + ], }, }); diff --git a/packages/typegpu-testing-utility/package.json b/packages/typegpu-testing-utility/package.json new file mode 100644 index 0000000000..de7f7dbd13 --- /dev/null +++ b/packages/typegpu-testing-utility/package.json @@ -0,0 +1,23 @@ +{ + "name": "typegpu-testing-utility", + "version": "0.0.0", + "private": true, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/software-mansion/TypeGPU.git" + }, + "type": "module", + "sideEffects": false, + "exports": "./src/index.ts", + "dependencies": { + "typegpu": "workspace:*" + }, + "devDependencies": { + "typescript": "catalog:types" + }, + "engines": { + "node": ">=12.20.0" + }, + "packageManager": "pnpm@10.15.1+sha512.34e538c329b5553014ca8e8f4535997f96180a1d0f614339357449935350d924e22f8614682191264ec33d1462ac21561aff97f6bb18065351c162c7e8f6de67" +} diff --git a/packages/typegpu/tests/utils/extendedIt.ts b/packages/typegpu-testing-utility/src/extendedIt.ts similarity index 96% rename from packages/typegpu/tests/utils/extendedIt.ts rename to packages/typegpu-testing-utility/src/extendedIt.ts index 0934b2d69f..5df4447686 100644 --- a/packages/typegpu/tests/utils/extendedIt.ts +++ b/packages/typegpu-testing-utility/src/extendedIt.ts @@ -1,12 +1,12 @@ +// oxlint-disable no-unused-vars import { it as base, vi } from 'vitest'; -import type { ExperimentalTgpuRoot } from '../../src/core/root/rootTypes.ts'; -import tgpu from '../../src/index.js'; +import tgpu, { type TgpuRoot } from 'typegpu'; // oxlint-disable-next-line import/no-unassigned-import -- imported for side effects import './webgpuGlobals.ts'; const adapterMock = { features: new Set(['timestamp-query']), - requestDevice: vi.fn((descriptor) => Promise.resolve(mockDevice)), + requestDevice: vi.fn((_descriptor) => Promise.resolve(mockDevice)), limits: { maxStorageBufferBindingSize: 64 * 1024 * 1024, }, @@ -155,6 +155,8 @@ const mockDevice = { destroy: vi.fn(), }; +type ExperimentalTgpuRoot = TgpuRoot & TgpuRoot['~unstable']; + export const it = base.extend<{ _global: undefined; commandEncoder: GPUCommandEncoder & { mock: typeof mockCommandEncoder }; diff --git a/packages/typegpu-testing-utility/src/index.ts b/packages/typegpu-testing-utility/src/index.ts new file mode 100644 index 0000000000..84a4d236fd --- /dev/null +++ b/packages/typegpu-testing-utility/src/index.ts @@ -0,0 +1 @@ +export { it, test } from './extendedIt.ts'; diff --git a/packages/typegpu/tests/utils/webgpuGlobals.ts b/packages/typegpu-testing-utility/src/webgpuGlobals.ts similarity index 100% rename from packages/typegpu/tests/utils/webgpuGlobals.ts rename to packages/typegpu-testing-utility/src/webgpuGlobals.ts diff --git a/packages/typegpu-testing-utility/tsconfig.json b/packages/typegpu-testing-utility/tsconfig.json new file mode 100644 index 0000000000..9536a0f413 --- /dev/null +++ b/packages/typegpu-testing-utility/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.base.json" +} diff --git a/packages/typegpu/package.json b/packages/typegpu/package.json index 02b2229ef0..267fa38eca 100644 --- a/packages/typegpu/package.json +++ b/packages/typegpu/package.json @@ -93,6 +93,7 @@ "jiti": "catalog:build", "jsdom": "^27.0.0", "tsdown": "catalog:build", + "typegpu-testing-utility": "workspace:*", "typescript": "catalog:types", "unplugin-typegpu": "workspace:*", "wgpu-matrix": "catalog:example" diff --git a/packages/typegpu/tests/accessor.test.ts b/packages/typegpu/tests/accessor.test.ts index 5bebfed82f..a54d939335 100644 --- a/packages/typegpu/tests/accessor.test.ts +++ b/packages/typegpu/tests/accessor.test.ts @@ -1,6 +1,6 @@ import { describe, expect, expectTypeOf } from 'vitest'; import tgpu, { d, std, type TgpuAccessor } from '../src/index.js'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; const RED = d.vec3f(1, 0, 0); const Boid = d.struct({ diff --git a/packages/typegpu/tests/bindGroupLayout.test.ts b/packages/typegpu/tests/bindGroupLayout.test.ts index 220cddc9d9..664048858c 100644 --- a/packages/typegpu/tests/bindGroupLayout.test.ts +++ b/packages/typegpu/tests/bindGroupLayout.test.ts @@ -15,9 +15,7 @@ import { type TgpuLayoutSampler, type UnwrapRuntimeConstructor, } from '../src/tgpuBindGroupLayout.ts'; -import { it } from './utils/extendedIt.ts'; -// oxlint-disable-next-line import/no-unassigned-import -- imported for side effects -import './utils/webgpuGlobals.ts'; +import { it } from 'typegpu-testing-utility'; const DEFAULT_READONLY_VISIBILITY_FLAGS = GPUShaderStage.COMPUTE | GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT; diff --git a/packages/typegpu/tests/buffer.test.ts b/packages/typegpu/tests/buffer.test.ts index c9879ecc4f..9c6335384f 100644 --- a/packages/typegpu/tests/buffer.test.ts +++ b/packages/typegpu/tests/buffer.test.ts @@ -5,7 +5,7 @@ import type { ValidateBufferSchema, ValidUsagesFor } from '../src/index.js'; import { getName } from '../src/shared/meta.ts'; import type { IsValidBufferSchema, IsValidUniformSchema } from '../src/shared/repr.ts'; import type { TypedArray } from '../src/shared/utilityTypes.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; function toUint8Array(...arrays: Array): Uint8Array { let totalByteLength = 0; diff --git a/packages/typegpu/tests/bufferShorthands.test.ts b/packages/typegpu/tests/bufferShorthands.test.ts index f0ab21cd48..c39f080a38 100644 --- a/packages/typegpu/tests/bufferShorthands.test.ts +++ b/packages/typegpu/tests/bufferShorthands.test.ts @@ -1,6 +1,6 @@ import { describe, expect, expectTypeOf } from 'vitest'; import * as d from '../src/data/index.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import type { StorageFlag, TgpuBuffer, diff --git a/packages/typegpu/tests/bufferUsage.test.ts b/packages/typegpu/tests/bufferUsage.test.ts index b4db3787b1..d3ca51e60b 100644 --- a/packages/typegpu/tests/bufferUsage.test.ts +++ b/packages/typegpu/tests/bufferUsage.test.ts @@ -2,7 +2,7 @@ import { describe, expect, expectTypeOf } from 'vitest'; import { d, tgpu } from '../src/index.js'; import type { Infer } from '../src/shared/repr.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('TgpuBufferUniform', () => { it('represents a `number` value', ({ root }) => { diff --git a/packages/typegpu/tests/compiledIO.test.ts b/packages/typegpu/tests/compiledIO.test.ts index 265f540186..530bb2eb74 100644 --- a/packages/typegpu/tests/compiledIO.test.ts +++ b/packages/typegpu/tests/compiledIO.test.ts @@ -2,7 +2,7 @@ import { describe, expect } from 'vitest'; import { buildWriter, getCompiledWriterForSchema } from '../src/data/compiledIO.ts'; import * as d from '../src/data/index.ts'; import { sizeOf } from '../src/data/sizeOf.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('buildWriter', () => { it('should compile a writer for a struct', () => { diff --git a/packages/typegpu/tests/computePipeline.test.ts b/packages/typegpu/tests/computePipeline.test.ts index fdf4ca07dc..0c81b70098 100644 --- a/packages/typegpu/tests/computePipeline.test.ts +++ b/packages/typegpu/tests/computePipeline.test.ts @@ -2,7 +2,7 @@ import { describe, expect, expectTypeOf, vi } from 'vitest'; import type { TgpuQuerySet } from '../src/core/querySet/querySet.ts'; import { d, MissingBindGroupsError, tgpu, type TgpuComputePipeline } from '../src/index.js'; import { $internal } from '../src/shared/symbols.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { extensionEnabled } from '../src/std/extensions.ts'; describe('TgpuComputePipeline', () => { diff --git a/packages/typegpu/tests/disarray.test.ts b/packages/typegpu/tests/disarray.test.ts index e1aaff6305..97454513bc 100644 --- a/packages/typegpu/tests/disarray.test.ts +++ b/packages/typegpu/tests/disarray.test.ts @@ -2,7 +2,7 @@ import { BufferReader, BufferWriter } from 'typed-binary'; import { describe, expect, expectTypeOf } from 'vitest'; import { readData, writeData } from '../src/data/dataIO.ts'; import * as d from '../src/data/index.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('disarray', () => { it('does not take element alignment into account when measuring', () => { diff --git a/packages/typegpu/tests/gpuValueOf.test.ts b/packages/typegpu/tests/gpuValueOf.test.ts index 23643cbc55..9c4a87abc3 100644 --- a/packages/typegpu/tests/gpuValueOf.test.ts +++ b/packages/typegpu/tests/gpuValueOf.test.ts @@ -2,7 +2,7 @@ import { describe, expectTypeOf } from 'vitest'; import * as d from '../src/data/index.ts'; import tgpu from '../src/index.js'; import type { GPUValueOf } from '../src/shared/repr.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('GPUValueOf', () => { it('extracts value of tgpu.privateVar', () => { diff --git a/packages/typegpu/tests/guardedComputePipeline.test.ts b/packages/typegpu/tests/guardedComputePipeline.test.ts index 6e4e333d60..065101fc82 100644 --- a/packages/typegpu/tests/guardedComputePipeline.test.ts +++ b/packages/typegpu/tests/guardedComputePipeline.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from 'vitest'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { getName } from '../src/shared/meta.ts'; import { bindGroupLayout } from '../src/tgpuBindGroupLayout.ts'; import { f32 } from '../src/data/numeric.ts'; diff --git a/packages/typegpu/tests/lazy.test.ts b/packages/typegpu/tests/lazy.test.ts index a2b93ffacd..5058c537e2 100644 --- a/packages/typegpu/tests/lazy.test.ts +++ b/packages/typegpu/tests/lazy.test.ts @@ -2,7 +2,7 @@ import { describe, expect, expectTypeOf, vi } from 'vitest'; import * as d from '../src/data/index.ts'; import tgpu, { type TgpuLazy } from '../src/index.js'; import { mul } from '../src/std/index.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('TgpuLazy', () => { it('memoizes results of transitive "lazy" objects', () => { diff --git a/packages/typegpu/tests/limitsOverflow.test.ts b/packages/typegpu/tests/limitsOverflow.test.ts index 074f36ad5b..f0630e8ee5 100644 --- a/packages/typegpu/tests/limitsOverflow.test.ts +++ b/packages/typegpu/tests/limitsOverflow.test.ts @@ -1,5 +1,5 @@ import { describe, expect, vi } from 'vitest'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d } from '../src/index.js'; import { warnIfOverflow } from '../src/core/pipeline/limitsOverflow.ts'; diff --git a/packages/typegpu/tests/namespace.test.ts b/packages/typegpu/tests/namespace.test.ts index 5fc69a3964..ee6fe33099 100644 --- a/packages/typegpu/tests/namespace.test.ts +++ b/packages/typegpu/tests/namespace.test.ts @@ -1,6 +1,6 @@ import { describe, expect, vi } from 'vitest'; import tgpu, { d } from '../src/index.js'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('tgpu.namespace', () => { it('defines direct dependencies only once', () => { diff --git a/packages/typegpu/tests/partialIo.test.ts b/packages/typegpu/tests/partialIo.test.ts index 950c95db89..2b9135a7c9 100644 --- a/packages/typegpu/tests/partialIo.test.ts +++ b/packages/typegpu/tests/partialIo.test.ts @@ -3,7 +3,7 @@ import * as d from '../src/data/index.ts'; import { offsetsForProps } from '../src/data/offsets.ts'; import { getWriteInstructions, type WriteInstruction } from '../src/data/partialIO.ts'; import type { TypedArray } from '../src/shared/utilityTypes.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; function expectInstruction( instruction: WriteInstruction, diff --git a/packages/typegpu/tests/pipeline-resolution.test.ts b/packages/typegpu/tests/pipeline-resolution.test.ts index 6b04736a39..96cd160fa3 100644 --- a/packages/typegpu/tests/pipeline-resolution.test.ts +++ b/packages/typegpu/tests/pipeline-resolution.test.ts @@ -1,6 +1,6 @@ import { describe, expect } from 'vitest'; import tgpu, { d } from '../src/index.js'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('resolve', () => { const Boid = d.struct({ diff --git a/packages/typegpu/tests/querySet.test.ts b/packages/typegpu/tests/querySet.test.ts index 25ceee2e63..832452eac4 100644 --- a/packages/typegpu/tests/querySet.test.ts +++ b/packages/typegpu/tests/querySet.test.ts @@ -1,7 +1,7 @@ import { describe, expect, vi } from 'vitest'; import { getName } from '../src/shared/meta.ts'; import { $internal } from '../src/shared/symbols.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('TgpuQuerySet', () => { it('should be namable', ({ root }) => { diff --git a/packages/typegpu/tests/ref.test.ts b/packages/typegpu/tests/ref.test.ts index 1470936a17..2de56c7b5d 100644 --- a/packages/typegpu/tests/ref.test.ts +++ b/packages/typegpu/tests/ref.test.ts @@ -1,6 +1,6 @@ import tgpu, { d } from '../src/index.js'; import { describe, expect } from 'vitest'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('d.ref', () => { it('fails when using a ref as an external', () => { diff --git a/packages/typegpu/tests/renderPipeline.test.ts b/packages/typegpu/tests/renderPipeline.test.ts index 6de830fb9e..39b3b128b6 100644 --- a/packages/typegpu/tests/renderPipeline.test.ts +++ b/packages/typegpu/tests/renderPipeline.test.ts @@ -11,7 +11,7 @@ import tgpu, { type TgpuVertexFnShell, } from '../src/index.js'; import { $internal } from '../src/shared/symbols.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('root.withVertex(...).withFragment(...)', () => { const vert = tgpu.vertexFn({ diff --git a/packages/typegpu/tests/resolve.test.ts b/packages/typegpu/tests/resolve.test.ts index 394eef53d9..4587a42fdc 100644 --- a/packages/typegpu/tests/resolve.test.ts +++ b/packages/typegpu/tests/resolve.test.ts @@ -3,7 +3,7 @@ import tgpu, { d } from '../src/index.js'; import { setName } from '../src/shared/meta.ts'; import { $gpuValueOf, $internal, $ownSnippet, $resolve } from '../src/shared/symbols.ts'; import type { ResolutionCtx } from '../src/types.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { snip } from '../src/data/snippet.ts'; describe('tgpu resolve', () => { diff --git a/packages/typegpu/tests/root.test.ts b/packages/typegpu/tests/root.test.ts index ab997a0de3..525e9a0007 100644 --- a/packages/typegpu/tests/root.test.ts +++ b/packages/typegpu/tests/root.test.ts @@ -1,7 +1,7 @@ import { describe, expect, vi } from 'vitest'; import { Void } from '../src/data/wgslTypes.ts'; import tgpu, { d } from '../src/index.js'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('TgpuRoot', () => { describe('.createBuffer', () => { diff --git a/packages/typegpu/tests/simulate.test.ts b/packages/typegpu/tests/simulate.test.ts index 377c88043a..b3310f1f71 100644 --- a/packages/typegpu/tests/simulate.test.ts +++ b/packages/typegpu/tests/simulate.test.ts @@ -1,6 +1,6 @@ import { describe, expect } from 'vitest'; import tgpu, { d } from '../src/index.js'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('tgpu.simulate()', () => { it('runs the callback synchronously and returns the result', () => { diff --git a/packages/typegpu/tests/slot.test.ts b/packages/typegpu/tests/slot.test.ts index 4b30c7bea4..cb81c51517 100644 --- a/packages/typegpu/tests/slot.test.ts +++ b/packages/typegpu/tests/slot.test.ts @@ -1,6 +1,6 @@ import { describe, expect } from 'vitest'; import tgpu, { d, std } from '../src/index.js'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { getName } from '../src/shared/meta.ts'; const RED = 'vec3f(1., 0., 0.)'; diff --git a/packages/typegpu/tests/std/numeric/frexp.test.ts b/packages/typegpu/tests/std/numeric/frexp.test.ts index 78752a77f5..c35590d698 100644 --- a/packages/typegpu/tests/std/numeric/frexp.test.ts +++ b/packages/typegpu/tests/std/numeric/frexp.test.ts @@ -1,5 +1,5 @@ import { describe, expect, expectTypeOf } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { frexp } from '../../../src/std/numeric.ts'; import { vec2f, vec3h } from '../../../src/data/vector.ts'; import type { v2f, v2i, v3i } from '../../../src/data/index.ts'; diff --git a/packages/typegpu/tests/std/numeric/modf.test.ts b/packages/typegpu/tests/std/numeric/modf.test.ts index e3387890cc..3c1697bedc 100644 --- a/packages/typegpu/tests/std/numeric/modf.test.ts +++ b/packages/typegpu/tests/std/numeric/modf.test.ts @@ -1,5 +1,5 @@ import { describe, expect, expectTypeOf } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { modf } from '../../../src/std/numeric.ts'; import { vec2f, vec3h } from '../../../src/data/vector.ts'; import type { v2f } from '../../../src/data/index.ts'; diff --git a/packages/typegpu/tests/std/texture/textureGather.test.ts b/packages/typegpu/tests/std/texture/textureGather.test.ts index ac62dec1f2..902cc8ae4e 100644 --- a/packages/typegpu/tests/std/texture/textureGather.test.ts +++ b/packages/typegpu/tests/std/texture/textureGather.test.ts @@ -1,5 +1,5 @@ import { describe, expect, expectTypeOf } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { textureGather } from '../../../src/std/texture.ts'; import tgpu from '../../../src/index.js'; import * as d from '../../../src/data/index.ts'; diff --git a/packages/typegpu/tests/std/texture/textureLoad.test.ts b/packages/typegpu/tests/std/texture/textureLoad.test.ts index 7ad60318a4..5776af3459 100644 --- a/packages/typegpu/tests/std/texture/textureLoad.test.ts +++ b/packages/typegpu/tests/std/texture/textureLoad.test.ts @@ -1,5 +1,5 @@ import { describe, expect, expectTypeOf } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { textureLoad } from '../../../src/std/texture.ts'; import tgpu from '../../../src/index.js'; import * as d from '../../../src/data/index.ts'; diff --git a/packages/typegpu/tests/std/texture/textureSample.test.ts b/packages/typegpu/tests/std/texture/textureSample.test.ts index 508c003912..a9f667cd0d 100644 --- a/packages/typegpu/tests/std/texture/textureSample.test.ts +++ b/packages/typegpu/tests/std/texture/textureSample.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from 'vitest'; -import { it } from '../../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { textureSample } from '../../../src/std/texture.ts'; import { fn } from '../../../src/core/function/tgpuFn.ts'; import * as d from '../../../src/data/index.ts'; diff --git a/packages/typegpu/tests/texture.test.ts b/packages/typegpu/tests/texture.test.ts index adec4f6102..450537c8f5 100644 --- a/packages/typegpu/tests/texture.test.ts +++ b/packages/typegpu/tests/texture.test.ts @@ -2,10 +2,8 @@ import { describe, expect, expectTypeOf, vi } from 'vitest'; import type { TgpuTexture, TgpuTextureView } from '../src/core/texture/texture.ts'; import type { RenderFlag, SampledFlag } from '../src/core/texture/usageExtension.ts'; import type { ExperimentalTgpuRoot } from '../src/core/root/rootTypes.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import * as d from '../src/data/index.ts'; -// oxlint-disable-next-line import/no-unassigned-import -- imported for side effects -import './utils/webgpuGlobals.ts'; import { attest } from '@ark/attest'; import tgpu from '../src/index.js'; import { getName } from '../src/shared/meta.ts'; diff --git a/packages/typegpu/tests/tgpuGenericFn.test.ts b/packages/typegpu/tests/tgpuGenericFn.test.ts index 48a6cb6460..363ddd2e33 100644 --- a/packages/typegpu/tests/tgpuGenericFn.test.ts +++ b/packages/typegpu/tests/tgpuGenericFn.test.ts @@ -1,7 +1,7 @@ import { describe, expect } from 'vitest'; import * as d from '../src/data/index.ts'; import tgpu, { std } from '../src/index.js'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('TgpuGenericFn - shellless callback wrapper', () => { it('can be called in js', () => { diff --git a/packages/typegpu/tests/tgsl/argumentOrigin.test.ts b/packages/typegpu/tests/tgsl/argumentOrigin.test.ts index ed2ad8494a..c0470247c7 100644 --- a/packages/typegpu/tests/tgsl/argumentOrigin.test.ts +++ b/packages/typegpu/tests/tgsl/argumentOrigin.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d } from '../../src/index.js'; describe('function argument origin tracking', () => { diff --git a/packages/typegpu/tests/tgsl/assignment.test.ts b/packages/typegpu/tests/tgsl/assignment.test.ts index 6839c573c9..dc8961413d 100644 --- a/packages/typegpu/tests/tgsl/assignment.test.ts +++ b/packages/typegpu/tests/tgsl/assignment.test.ts @@ -1,5 +1,5 @@ import { beforeEach, expect, type MockInstance, vi } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d } from '../../src/index.js'; let warnSpy: MockInstance; diff --git a/packages/typegpu/tests/tgsl/codeGen.test.ts b/packages/typegpu/tests/tgsl/codeGen.test.ts index 53d21f8804..38f48adc6e 100644 --- a/packages/typegpu/tests/tgsl/codeGen.test.ts +++ b/packages/typegpu/tests/tgsl/codeGen.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d } from '../../src/index.js'; diff --git a/packages/typegpu/tests/tgsl/comptime.test.ts b/packages/typegpu/tests/tgsl/comptime.test.ts index 4daae884f2..f4fc57f42c 100644 --- a/packages/typegpu/tests/tgsl/comptime.test.ts +++ b/packages/typegpu/tests/tgsl/comptime.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d } from '../../src/index.js'; describe('comptime', () => { diff --git a/packages/typegpu/tests/tgsl/consoleLog.test.ts b/packages/typegpu/tests/tgsl/consoleLog.test.ts index e0ec4115e7..5786ca435b 100644 --- a/packages/typegpu/tests/tgsl/consoleLog.test.ts +++ b/packages/typegpu/tests/tgsl/consoleLog.test.ts @@ -4,7 +4,7 @@ import tgpu, { d } from '../../src/index.js'; import { ResolutionCtxImpl } from '../../src/resolutionCtx.ts'; import { deserializeAndStringify } from '../../src/tgsl/consoleLog/deserializers.ts'; import { CodegenState } from '../../src/types.ts'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('wgslGenerator with console.log', () => { let ctx: ResolutionCtxImpl; diff --git a/packages/typegpu/tests/tgsl/conversion.test.ts b/packages/typegpu/tests/tgsl/conversion.test.ts index 4767fd3e2a..ee72863801 100644 --- a/packages/typegpu/tests/tgsl/conversion.test.ts +++ b/packages/typegpu/tests/tgsl/conversion.test.ts @@ -7,7 +7,7 @@ import { convertToCommonType, getBestConversion, } from '../../src/tgsl/conversion.ts'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { INTERNAL_setCtx } from '../../src/execMode.ts'; import { CodegenState } from '../../src/types.ts'; import { UnknownData } from '../../src/data/dataTypes.ts'; diff --git a/packages/typegpu/tests/tgsl/extensionEnabled.test.ts b/packages/typegpu/tests/tgsl/extensionEnabled.test.ts index 946337cc72..727e9fed70 100644 --- a/packages/typegpu/tests/tgsl/extensionEnabled.test.ts +++ b/packages/typegpu/tests/tgsl/extensionEnabled.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d, std } from '../../src/index.js'; diff --git a/packages/typegpu/tests/tgsl/infixOperators.test.ts b/packages/typegpu/tests/tgsl/infixOperators.test.ts index c945fbcbf9..2e18ed3331 100644 --- a/packages/typegpu/tests/tgsl/infixOperators.test.ts +++ b/packages/typegpu/tests/tgsl/infixOperators.test.ts @@ -1,6 +1,6 @@ import { describe, expect } from 'vitest'; import tgpu, { d } from '../../src/index.js'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('wgslGenerator', () => { it('resolves add infix operator', () => { diff --git a/packages/typegpu/tests/tgsl/memberAccess.test.ts b/packages/typegpu/tests/tgsl/memberAccess.test.ts index 3553de25a9..dfa33a9f34 100644 --- a/packages/typegpu/tests/tgsl/memberAccess.test.ts +++ b/packages/typegpu/tests/tgsl/memberAccess.test.ts @@ -1,5 +1,5 @@ import { describe } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { expectSnippetOf } from '../utils/parseResolved.ts'; import { snip } from '../../src/data/snippet.ts'; import tgpu, { d } from '../../src/index.js'; diff --git a/packages/typegpu/tests/tgsl/nameClashes.test.ts b/packages/typegpu/tests/tgsl/nameClashes.test.ts index c98b352e10..feb43d82a9 100644 --- a/packages/typegpu/tests/tgsl/nameClashes.test.ts +++ b/packages/typegpu/tests/tgsl/nameClashes.test.ts @@ -1,6 +1,6 @@ import { expect } from 'vitest'; import tgpu, { d, std } from '../../src/index.js'; -import { test } from '../utils/extendedIt.ts'; +import { test } from 'typegpu-testing-utility'; test('should differentiate parameter names from existing declarations', () => { const fooFn = tgpu diff --git a/packages/typegpu/tests/tgsl/operatorOverloads.test.ts b/packages/typegpu/tests/tgsl/operatorOverloads.test.ts index 6b54896bb1..a351fefcb4 100644 --- a/packages/typegpu/tests/tgsl/operatorOverloads.test.ts +++ b/packages/typegpu/tests/tgsl/operatorOverloads.test.ts @@ -1,6 +1,6 @@ import { describe, expect } from 'vitest'; import { d, tgpu } from '../../src/index.js'; -import { test } from '../utils/extendedIt.ts'; +import { test } from 'typegpu-testing-utility'; test('vec3f() +', () => { const main = () => { diff --git a/packages/typegpu/tests/tgsl/rawCodeSnippet.test.ts b/packages/typegpu/tests/tgsl/rawCodeSnippet.test.ts index 08e0ca622b..b0dcd5f70b 100644 --- a/packages/typegpu/tests/tgsl/rawCodeSnippet.test.ts +++ b/packages/typegpu/tests/tgsl/rawCodeSnippet.test.ts @@ -1,5 +1,5 @@ import { describe, expect, expectTypeOf } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d } from '../../src/index.js'; describe('rawCodeSnippet', () => { diff --git a/packages/typegpu/tests/tgsl/shellless.test.ts b/packages/typegpu/tests/tgsl/shellless.test.ts index ab29bcb432..dffa03992f 100644 --- a/packages/typegpu/tests/tgsl/shellless.test.ts +++ b/packages/typegpu/tests/tgsl/shellless.test.ts @@ -8,7 +8,7 @@ import tgpu, { type TgpuTextureView, type TgpuUniform, } from '../../src/index.js'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('shellless', () => { it('is callable from shelled function', () => { diff --git a/packages/typegpu/tests/tgsl/ternaryOperator.test.ts b/packages/typegpu/tests/tgsl/ternaryOperator.test.ts index 06c33137ae..fd37903d12 100644 --- a/packages/typegpu/tests/tgsl/ternaryOperator.test.ts +++ b/packages/typegpu/tests/tgsl/ternaryOperator.test.ts @@ -1,5 +1,5 @@ import { describe, expect } from 'vitest'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import tgpu, { d, std } from '../../src/index.js'; describe('ternary operator', () => { diff --git a/packages/typegpu/tests/tgsl/wgslGenerator.test.ts b/packages/typegpu/tests/tgsl/wgslGenerator.test.ts index 4a6515689f..209a220148 100644 --- a/packages/typegpu/tests/tgsl/wgslGenerator.test.ts +++ b/packages/typegpu/tests/tgsl/wgslGenerator.test.ts @@ -13,7 +13,7 @@ import { $internal } from '../../src/shared/symbols.ts'; import * as std from '../../src/std/index.ts'; import wgslGenerator from '../../src/tgsl/wgslGenerator.ts'; import { CodegenState } from '../../src/types.ts'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import { ArrayExpression } from '../../src/tgsl/generationHelpers.ts'; import { extractSnippetFromFn } from '../utils/parseResolved.ts'; diff --git a/packages/typegpu/tests/tgslFn.test.ts b/packages/typegpu/tests/tgslFn.test.ts index ce066195a7..dd268f61d7 100644 --- a/packages/typegpu/tests/tgslFn.test.ts +++ b/packages/typegpu/tests/tgslFn.test.ts @@ -3,7 +3,7 @@ import { describe, expect } from 'vitest'; import { builtin } from '../src/builtin.ts'; import tgpu, { d, type TgpuFn, type TgpuSlot } from '../src/index.js'; import { getName } from '../src/shared/meta.ts'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('TGSL tgpu.fn function', () => { it('is namable', () => { diff --git a/packages/typegpu/tests/unplugin/autoname.test.ts b/packages/typegpu/tests/unplugin/autoname.test.ts index 87ca26636c..bf793faa40 100644 --- a/packages/typegpu/tests/unplugin/autoname.test.ts +++ b/packages/typegpu/tests/unplugin/autoname.test.ts @@ -2,7 +2,7 @@ import { describe, expect } from 'vitest'; import { struct } from '../../src/data/index.ts'; import tgpu, { d, type TgpuBindGroupLayout } from '../../src/index.js'; import { getName } from '../../src/shared/meta.ts'; -import { it } from '../utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; describe('autonaming', () => { it('autonames resources created using tgpu', () => { diff --git a/packages/typegpu/tests/unroll.test.ts b/packages/typegpu/tests/unroll.test.ts index 790f7be049..474e2a2e0e 100644 --- a/packages/typegpu/tests/unroll.test.ts +++ b/packages/typegpu/tests/unroll.test.ts @@ -1,5 +1,5 @@ import { describe, expect, vi } from 'vitest'; -import { it } from './utils/extendedIt.ts'; +import { it } from 'typegpu-testing-utility'; import * as d from '../src/data/index.ts'; import tgpu from '../src/index.js'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 78dcf486e8..3c2883cc10 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -369,6 +369,9 @@ importers: tailwindcss-motion: specifier: ^1.1.1 version: 1.1.1(tailwindcss@4.1.11) + typegpu-testing-utility: + specifier: workspace:* + version: link:../../packages/typegpu-testing-utility vite-imagetools: specifier: catalog:frontend version: 9.0.0(rollup@4.34.8) @@ -525,6 +528,9 @@ importers: tsdown: specifier: catalog:build version: 0.20.3(tsover@5.9.11) + typegpu-testing-utility: + specifier: workspace:* + version: link:../typegpu-testing-utility typescript: specifier: npm:tsover@^5.9.11 version: tsover@5.9.11 @@ -674,6 +680,16 @@ importers: version: link:../unplugin-typegpu publishDirectory: dist + packages/typegpu-testing-utility: + dependencies: + typegpu: + specifier: workspace:* + version: link:../typegpu + devDependencies: + typescript: + specifier: npm:tsover@^5.9.11 + version: tsover@5.9.11 + packages/typegpu-three: dependencies: three: From ddd33e822bf92d4de85320fbb008c5666427b153 Mon Sep 17 00:00:00 2001 From: Iwo Plaza Date: Mon, 16 Mar 2026 16:10:42 +0100 Subject: [PATCH 2/2] Update packages/typegpu-testing-utility/package.json Co-authored-by: Aleksander Katan <56294622+aleksanderkatan@users.noreply.github.com> --- packages/typegpu-testing-utility/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/typegpu-testing-utility/package.json b/packages/typegpu-testing-utility/package.json index de7f7dbd13..12c9524a5b 100644 --- a/packages/typegpu-testing-utility/package.json +++ b/packages/typegpu-testing-utility/package.json @@ -8,7 +8,6 @@ "url": "git+https://github.com/software-mansion/TypeGPU.git" }, "type": "module", - "sideEffects": false, "exports": "./src/index.ts", "dependencies": { "typegpu": "workspace:*"