Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: resolve 8 test failures (stair fixtures, spawn icon, Zod v4 introspection, three-mesh-bvh)#329

Open
jelharou wants to merge 1 commit into
pascalorg:main from
jelharou:fix/test-failures-after-pull
Open

fix: resolve 8 test failures (stair fixtures, spawn icon, Zod v4 introspection, three-mesh-bvh) #329
jelharou wants to merge 1 commit into
pascalorg:main from
jelharou:fix/test-failures-after-pull

Conversation

@jelharou

@jelharou jelharou commented May 21, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes all 8 test failures that appeared after pulling the latest main (shelf v2, IconRef url kind, StairOpeningSystem commits). Four distinct root causes:

1. stair-opening-sync tests (4 failures)
manualOpening fixtures used z ∈ [0.8, 2.9] but the computed stair opening expands to z ∈ [0.05, 2.95] (position[2]=0.2 minus openingOffset=0.15). isCoveredByExistingHole requires full polygon containment, so the auto-hole was not suppressed. Fixtures updated to z ∈ [0, 3].

2. Spawn parity test (1 failure)
Commit 6a1d853 (IconRef: add url kind) changed all registered icon refs from { kind: 'iconify' } to { kind: 'url' }. Test assertion still expected 'iconify'. Updated to 'url'.

3. builtinPlugin discriminator test (1 failure)
nodeType() wraps z.literal(kind) in ZodDefault so nodes parse without an explicit type field. In Zod v4, ZodDefault has no .value property — the test was written for Zod v3's bare ZodLiteral. Fixed introspection to unwrap via .def?.innerType before reading .value.

4. geometry.test.ts errors (2 errors)
Shelf v2 added import ... from '@pascal-app/viewer' to geometry.ts. The viewer barrel transitively loads wall-systemthree-bvh-csgthree-mesh-bvh@0.9.9 as CJS/UMD (because three-bvh-csg lacks exports conditions). That UMD has a class-initialization-order bug in Bun's test environment. Added bunfig.toml + test-preload.ts to mock three-bvh-csg globally — no test exercises CSG at runtime, so this is safe.

How to test

  1. Pull this branch: git fetch fork fix/test-failures-after-pull && git checkout fix/test-failures-after-pull
  2. Run bun test from the repo root
  3. Expect: 662 pass, 0 fail, 0 errors

Screenshots / screen recording

N/A — non-visual change (test fixes only).

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

×ばつ4): manualOpening fixtures used z ∈ [0.8, 2.9] but the computed stair opening expands to z ∈ [0.05, 2.95] (position[2]=0.2 minus openingOffset=0.15). isCoveredByExistingHole requires full containment, so the auto-hole was not suppressed. Fixtures updated to z ∈ [0, 3]. - spawn parity test (×ばつ1): commit 6a1d853 switched all icon refs from iconify to url kind; test assertion still expected 'iconify'. Updated to 'url'. - builtinPlugin discriminator test (×ばつ1): nodeType() wraps z.literal(kind) in ZodDefault so nodes parse without an explicit type field. In Zod v4, ZodDefault has no .value; test assumed a bare ZodLiteral (Zod v3). Fixed introspection to unwrap via .def?.innerType before reading .value. - geometry.test.ts (×ばつ2 errors): shelf v2 added @pascal-app/viewer import to geometry.ts; the viewer barrel transitively loads three-bvh-csg → three-mesh-bvh @0.9.9 UMD, which has a class-init-order bug in Bun's test env. Added bunfig.toml + test-preload.ts to mock three-bvh-csg globally (no test exercises CSG at runtime). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>" data-pjax="true" href="/index.cgi/contrast/https://github.com/pascalorg/editor/pull/329/commits/fa55022ca9544701c337682ff5bea01b3420838b">fix: resolve 8 test failures introduced by recent commits
Three root causes addressed:
- stair-opening-sync tests (×ばつ4): manualOpening fixtures used z ∈ [0.8, 2.9]
 but the computed stair opening expands to z ∈ [0.05, 2.95] (position[2]=0.2
 minus openingOffset=0.15). isCoveredByExistingHole requires full containment,
 so the auto-hole was not suppressed. Fixtures updated to z ∈ [0, 3].
- spawn parity test (×ばつ1): commit 6a1d853 switched all icon refs from iconify
 to url kind; test assertion still expected 'iconify'. Updated to 'url'.
- builtinPlugin discriminator test (×ばつ1): nodeType() wraps z.literal(kind) in
 ZodDefault so nodes parse without an explicit type field. In Zod v4,
 ZodDefault has no .value; test assumed a bare ZodLiteral (Zod v3). Fixed
 introspection to unwrap via .def?.innerType before reading .value.
- geometry.test.ts (×ばつ2 errors): shelf v2 added @pascal-app/viewer import to
 geometry.ts; the viewer barrel transitively loads three-bvh-csg → three-mesh-bvh
 @0.9.9 UMD, which has a class-init-order bug in Bun's test env. Added
 bunfig.toml + test-preload.ts to mock three-bvh-csg globally (no test
 exercises CSG at runtime).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /