Skip to content

test: fix vitest vi.mock hoisting warnings and my-timezone resolution#1156

Merged
ffflorian merged 4 commits intomainfrom
claude/fix-test-warnings-W5IH2
Mar 28, 2026
Merged

test: fix vitest vi.mock hoisting warnings and my-timezone resolution#1156
ffflorian merged 4 commits intomainfrom
claude/fix-test-warnings-W5IH2

Conversation

@ffflorian
Copy link
Copy Markdown
Owner

@ffflorian ffflorian commented Mar 28, 2026

Summary

  • Move vi.mock('node:dgram') to the top level in ntpclient/src/index.test.ts (was nested inside beforeEach, triggering a vitest hoisting warning)
  • Move vi.mock('fs') and vi.mock('glob') to the top level in jszip-cli/src/BuildService.test.ts (were nested inside beforeAll, triggering vitest hoisting warnings)
  • Add packages/my-timezone/vitest.config.ts with a resolve alias for ntpclient pointing to its source, fixing a test failure when the ntpclient package has not been built yet

Test plan

  • yarn test passes with no vitest mock hoisting warnings
  • my-timezone tests pass without requiring a prior yarn build:ts

claude and others added 4 commits March 28, 2026 16:37
Move vi.mock calls to the top level in ntpclient and jszip-cli tests to
comply with vitest's module hoisting requirements. Add a vitest.config.ts
for my-timezone to resolve the ntpclient workspace package from source,
fixing test failures when ntpclient has not been built.
@ffflorian ffflorian merged commit c7f2a60 into main Mar 28, 2026
4 checks passed
@ffflorian ffflorian deleted the claude/fix-test-warnings-W5IH2 branch March 28, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants