Files
hyperframes/packages/player/vitest.config.ts
T
ClippyandClaude Opus 5.5 d77731aab5 chore(deps): update happy-dom to ^21.0.4 (#7641)
* chore(deps): update happy-dom to ^21.0.4

happy-dom 21 turns off iframe page loading by default. The player and
sdk test environments load same-origin iframe documents, so they opt
back in through their vitest happyDOM settings.

— Clippy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: adapt studio and cli tests to happy-dom 21

Studio tests load same-origin iframe documents, so they opt back in to
iframe page loading. happy-dom 21 adds Element.checkVisibility, which
reads the real styles rather than the mocked getComputedStyle, so the
motion-signature decoys are hidden in the DOM as well as in the mock.

— Clippy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(studio): fix remaining studio tests on happy-dom 21

- happy-dom now implements getAnimations, so Base UI deferred popup
  unmounts to animation frames; test setup sets Base UI's
  BASE_UI_ANIMATIONS_DISABLED, matching the old synchronous behaviour.
- happy-dom 21 drops vendor-prefixed properties it does not list, so the
  -webkit-text-fill-color tests move to a jsdom file with shared helpers.
- The scaled-iframe drag test builds its own Window, which now needs
  enableIframePageLoading.
- NLEPreview.slowBoot's per-file environment options never applied the
  disable setting and now wiped the config's iframe opt-in; drop them.

— Clippy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(studio): inline fill-test helpers instead of a shared module

Keeps the moved -webkit-text-fill-color tests self-contained and leaves
the original test file's helpers untouched.

— Clippy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(studio): drop the Base UI flag comment for the comment ratchet

— Clippy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:56:15 +00:00

43 lines
1.5 KiB
TypeScript

import { defineConfig } from "vitest/config";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
// fileURLToPath (not URL.pathname): on Windows .pathname yields "/D:/..." with a
// leading slash, which breaks resolve() and the alias below.
const coreRoot = resolve(fileURLToPath(new URL("../core/src", import.meta.url)));
export default defineConfig({
resolve: {
alias: {
"@hyperframes/core/runtime/composition-length": resolve(
coreRoot,
"runtime/compositionLength.ts",
),
"@hyperframes/core/studio-preview-mark": resolve(coreRoot, "studioPreviewMark.ts"),
"@hyperframes/core/composition-contract": resolve(coreRoot, "compositionContract.ts"),
"@hyperframes/parsers/composition-contract": resolve(
coreRoot,
"../../parsers/src/compositionContract.ts",
),
"@hyperframes/core/slideshow": resolve(coreRoot, "slideshow/index.ts"),
"@hyperframes/core/runtime/protocol": resolve(coreRoot, "runtime/protocol.ts"),
},
},
test: {
environment: "happy-dom",
environmentOptions: {
happyDOM: {
settings: {
handleDisabledFileLoadingAsSuccess: true,
enableIframePageLoading: true,
navigator: {
userAgent:
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36",
},
},
},
},
setupFiles: ["./src/slideshow/test-setup.ts"],
},
});