chore: jest => vitest#496
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughMigrates the monorepo test setup from Jest to Vitest: removes Jest configs and deps, updates package.json test scripts, adds Vitest configs and typings, adjusts tsconfig options, and updates tests/setup files to use Vitest APIs. Also adds a small CSS README Misc note. Changes
Sequence Diagram(s)(Skipped — changes are test-framework migration and configs without a new multi-component runtime control flow.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…le packages, updating configurations and scripts accordingly
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/grida-mixed-properties/vitest.config.ts`:
- Around line 1-7: Add the vitest global types to the TypeScript configuration
so the globals enabled in vitest.config.ts (via defineConfig and test.globals)
are recognized by the compiler: open your tsconfig.json and add "types":
["vitest/globals"] under compilerOptions (keeping existing options like
moduleResolution, esModuleInterop, noImplicitAny, strict), and ensure "exclude":
["dist"] is present so TypeScript recognizes describe/it/expect without type
errors.
♻️ Duplicate comments (1)
packages/grida-fonts/__tests__/fontface-dom.test.ts (1)
5-18: Same note as infontface.test.ts: confirmviglobals or add explicit import.
🧹 Nitpick comments (7)
packages/grida-canvas-schema/package.json (1)
7-7:vitestis available but not declared locally.The test script references
vitest run, and whilevitest ^4is available at the workspace root, it's not explicitly listed in this package'sdevDependencies. In a monorepo with hoisting, this is functional but adds friction if the package needs to run independently. Consider addingvitestas a devDependency here for clarity.packages/grida-canvas-io/__tests__/clipboard.test.ts (2)
7-38: Prefersatisfies/explicit typing overas unknown asto keep compile-time validation.Line 7 and Line 38 use
as unknown as io.clipboard.ClipboardPayload, which masks schema drift and can let tests pass with invalid payloads. Recommend restoringsatisfies(or an explicit type annotation) to keep type-checking meaningful. Please confirm the repo’s TypeScript version supportssatisfies(TS 4.9+).♻️ Suggested change
- const testPayload = { + const testPayload = { type: "prototypes", ids: ["<id>"], payload_id: "52b698ef-d06a-4f9c-ac4c-c26e744c8567", prototypes: [ { active: true, fill: { type: "solid", color: { r: 0, g: 0, b: 0, a: 1 }, active: true, }, font_family: "Inter", font_size: 14, font_weight: 400, layout_target_height: "auto", locked: false, name: "tspan", opacity: 1, layout_positioning: "absolute", text: "Text", type: "tspan", layout_target_width: "auto", z_index: 0, }, ], - } as unknown as io.clipboard.ClipboardPayload; + } satisfies io.clipboard.ClipboardPayload;
103-148: Avoidas unknown asonlargePrototypeto keep node shape checked.Line 103 and Line 148 cast the object to
grida.program.nodes.NodePrototype, which suppresses compile-time checks and can hide drift in node schemas. Suggest usingsatisfies(or an explicit type annotation) instead; please verify TS version compatibility.♻️ Suggested change
- const largePrototype = { + const largePrototype = { type: "container", name: "Root", active: true, locked: false, layout_positioning: "absolute", layout_target_width: 1000, layout_target_height: 1000, children: Array.from( { length: 100 }, (_, i) => ({ type: "container" as const, name: `Child ${i}`, active: true, locked: false, layout_positioning: "absolute" as const, layout_target_width: 100, layout_target_height: 100, children: Array.from( { length: 50 }, (_, j) => ({ type: "tspan" as const, name: `Text ${i}-${j}`, active: true, locked: false, layout_positioning: "absolute" as const, text: `This is text node ${i}-${j} with some content to make it larger`, font_family: "Inter", font_size: 14, font_weight: 400, layout_target_width: "auto" as const, layout_target_height: "auto" as const, fill: { type: "solid" as const, color: { r: 0, g: 0, b: 0, a: 1 }, active: true, }, opacity: 1, z_index: 0, }) ), }) ), - } as unknown as grida.program.nodes.NodePrototype; + } satisfies grida.program.nodes.NodePrototype;.ref/css/README.md (1)
31-34: Documentation addition looks good, but appears unrelated to the migration.This informational section about CSS property counts is useful documentation, but it doesn't relate to the Jest→Vitest migration objective of this PR. Consider splitting this into a separate commit or PR to keep changes focused.
packages/grida-fonts/tsconfig.json (1)
5-7: Confirm bundler resolution + Vitest globals won’t leak into build typings.If this tsconfig drives library builds/declaration emit,
moduleResolution: "bundler"andtypes: ["vitest/globals"]can alter module resolution and inject test globals into non-test code. Consider a test-only tsconfig (extends base) or ensure builds use a separate config. Also verify the repo’s TypeScript version supports"bundler"resolution (TS 5+).packages/grida-canvas-vn/tsconfig.json (1)
7-8: Consider isolating Vitest globals to a test-only tsconfig.Adding
types: ["vitest/globals"]to the main config makes test globals available in non-test files; if this config is used for builds, prefer a test-only tsconfig. Also noteskipLibCheckcan mask lib type issues—ensure release builds still validate declarations where needed.packages/grida-canvas-io-figma/tsconfig.json (1)
5-6: Consider isolating Vitest types to test files only.Adding
"vitest/globals"to the main tsconfig exposes test globals (describe,it,expect, etc.) to all source files, not just tests. This can lead to accidental usage of test utilities in production code without compile-time errors.A common pattern is to use a separate
tsconfig.test.jsonthat extends the base config and adds the Vitest types, or configure theincludearray to scope these types appropriately.That said, if this pattern is consistent across the repository and the team prefers simplicity, this is acceptable.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (43)
.ref/css/README.mdcrates/grida-canvas-wasm/jest.config.tscrates/grida-canvas-wasm/package.jsoncrates/grida-canvas-wasm/vitest.config.tseditor/vitest.d.tspackage.jsonpackages/grida-canvas-io-figma/tsconfig.jsonpackages/grida-canvas-io/__tests__/clipboard.test.tspackages/grida-canvas-io/tsconfig.jsonpackages/grida-canvas-schema/jest.config.tspackages/grida-canvas-schema/package.jsonpackages/grida-canvas-schema/tsconfig.jsonpackages/grida-canvas-schema/vitest.config.tspackages/grida-canvas-sequence/package.jsonpackages/grida-canvas-sequence/tsconfig.jsonpackages/grida-canvas-sequence/vitest.config.tspackages/grida-canvas-vn/jest.config.tspackages/grida-canvas-vn/package.jsonpackages/grida-canvas-vn/tsconfig.jsonpackages/grida-canvas-vn/vitest.config.tspackages/grida-cmath/package.jsonpackages/grida-cmath/vitest.config.tspackages/grida-fonts/__tests__/fontface-dom.test.tspackages/grida-fonts/__tests__/fontface.test.tspackages/grida-fonts/jest.config.tspackages/grida-fonts/package.jsonpackages/grida-fonts/tsconfig.jsonpackages/grida-fonts/vitest.config.tspackages/grida-fonts/vitest.setup.tspackages/grida-mixed-properties/package.jsonpackages/grida-mixed-properties/vitest.config.tspackages/grida-number-input/package.jsonpackages/grida-number-input/tsconfig.jsonpackages/grida-number-input/vitest.config.tspackages/grida-tokens/package.jsonpackages/grida-tokens/vitest.config.tspackages/grida-tree/package.jsonpackages/grida-tree/vitest.config.tspackages/lib/treearray/package.jsonpackages/lib/treearray/vitest.config.tspackages/react-p-queue/__tests__/batch.test.tspackages/react-p-queue/package.jsonpackages/react-p-queue/vitest.config.ts
💤 Files with no reviewable changes (5)
- package.json
- packages/grida-canvas-schema/jest.config.ts
- packages/grida-fonts/jest.config.ts
- crates/grida-canvas-wasm/jest.config.ts
- packages/grida-canvas-vn/jest.config.ts
🧰 Additional context used
📓 Path-based instructions (1)
crates/grida-canvas-wasm/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (crates/grida-canvas-wasm/AGENTS.md)
Use Web Workers for heavy graphics operations to improve performance and responsiveness
Files:
crates/grida-canvas-wasm/vitest.config.ts
🧠 Learnings (16)
📚 Learning: 2025-12-01T00:22:06.800Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-fonts/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:06.800Z
Learning: Applies to crates/grida-canvas-fonts/**/*.rs : Run all tests with: `cargo test`
Applied to files:
packages/grida-fonts/package.jsonpackages/grida-fonts/vitest.setup.tscrates/grida-canvas-wasm/package.json
📚 Learning: 2025-12-01T00:22:19.083Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-wasm/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:19.083Z
Learning: Applies to crates/grida-canvas-wasm/**/main.rs : Update `grida-canvas-wasm.d.ts` TypeScript definitions file when new APIs are introduced via `main.rs`
Applied to files:
packages/grida-fonts/package.jsonpackages/grida-canvas-vn/vitest.config.tspackages/grida-tree/vitest.config.tspackages/grida-tokens/package.jsonpackages/grida-canvas-io/tsconfig.jsoncrates/grida-canvas-wasm/vitest.config.tspackages/grida-number-input/vitest.config.tspackages/grida-fonts/vitest.setup.tspackages/grida-canvas-schema/package.jsonpackages/grida-canvas-vn/package.jsonpackages/grida-canvas-vn/tsconfig.jsonpackages/grida-tokens/vitest.config.tspackages/grida-canvas-sequence/package.jsonpackages/grida-tree/package.jsonpackages/grida-number-input/tsconfig.jsonpackages/grida-cmath/vitest.config.tspackages/grida-canvas-io/__tests__/clipboard.test.tspackages/grida-cmath/package.jsoncrates/grida-canvas-wasm/package.jsonpackages/grida-canvas-sequence/vitest.config.tspackages/grida-canvas-sequence/tsconfig.jsonpackages/grida-mixed-properties/vitest.config.tspackages/grida-canvas-schema/vitest.config.tseditor/vitest.d.tspackages/grida-canvas-schema/tsconfig.jsonpackages/grida-canvas-io-figma/tsconfig.jsonpackages/grida-fonts/tsconfig.jsonpackages/grida-fonts/vitest.config.ts
📚 Learning: 2025-12-01T00:22:06.800Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-fonts/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:06.800Z
Learning: Applies to crates/grida-canvas-fonts/**/Cargo.toml : Include dev-dependency `serde_json = "1.0"` for JSON testing
Applied to files:
packages/grida-fonts/package.json
📚 Learning: 2026-01-10T04:48:31.415Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T04:48:31.415Z
Learning: Use turbo for monorepo tasks, build, dev, and test commands across all packages except isolated packages
Applied to files:
packages/grida-fonts/package.jsonpackages/lib/treearray/package.jsonpackages/react-p-queue/package.jsonpackages/grida-tokens/package.jsonpackages/grida-mixed-properties/package.jsonpackages/grida-canvas-vn/package.jsonpackages/grida-canvas-sequence/package.jsonpackages/grida-number-input/package.jsonpackages/grida-cmath/package.jsoncrates/grida-canvas-wasm/package.json
📚 Learning: 2025-12-01T00:22:41.045Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: editor/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:41.045Z
Learning: Applies to editor/**/next-env.d.ts : Include `next-env.d.ts` file in git for the project to avoid requiring dev/build runs for typechecking in CI environments
Applied to files:
packages/grida-fonts/package.jsonpackages/grida-canvas-vn/vitest.config.tspackages/lib/treearray/package.jsonpackages/react-p-queue/package.jsonpackages/grida-tokens/package.jsonpackages/grida-mixed-properties/package.jsonpackages/grida-canvas-io/tsconfig.jsonpackages/grida-canvas-schema/package.jsonpackages/grida-canvas-vn/package.jsonpackages/grida-canvas-vn/tsconfig.jsonpackages/grida-canvas-sequence/package.jsonpackages/grida-number-input/tsconfig.jsonpackages/grida-number-input/package.jsonpackages/grida-cmath/package.jsonpackages/grida-canvas-sequence/tsconfig.jsoneditor/vitest.d.tspackages/grida-canvas-schema/tsconfig.jsonpackages/grida-canvas-io-figma/tsconfig.jsonpackages/grida-fonts/tsconfig.json
📚 Learning: 2026-01-10T04:48:31.415Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T04:48:31.415Z
Learning: Run 'turbo typecheck' to verify TypeScript types across the repository
Applied to files:
packages/grida-fonts/package.jsonpackages/grida-canvas-sequence/package.jsonpackages/grida-number-input/package.json
📚 Learning: 2026-01-10T04:48:31.415Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T04:48:31.415Z
Learning: TypeScript files must pass build compilation before typecheck can succeed
Applied to files:
packages/grida-fonts/package.json
📚 Learning: 2025-12-01T00:22:19.083Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-wasm/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:19.083Z
Learning: For development and testing, use `just dev` command for debug builds with basic WebGL2 support
Applied to files:
packages/react-p-queue/package.jsonpackages/grida-tokens/package.jsonpackages/grida-canvas-vn/package.jsonpackages/grida-cmath/package.jsoncrates/grida-canvas-wasm/package.json
📚 Learning: 2025-12-01T00:22:06.800Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-fonts/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:06.800Z
Learning: Applies to crates/grida-canvas-fonts/**/get_*_test.rs : Style matching and face retrieval tests should be organized in files matching `get_*_test.rs`
Applied to files:
packages/grida-fonts/__tests__/fontface-dom.test.tspackages/grida-fonts/vitest.setup.tspackages/grida-fonts/__tests__/fontface.test.ts
📚 Learning: 2025-12-01T00:22:06.800Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-fonts/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:06.800Z
Learning: Applies to crates/grida-canvas-fonts/**/italic_level1.rs : Core font selection and italic detection tests should be organized in `italic_level1.rs`
Applied to files:
packages/grida-fonts/__tests__/fontface-dom.test.tspackages/grida-fonts/vitest.setup.tspackages/grida-fonts/__tests__/fontface.test.ts
📚 Learning: 2025-12-01T00:22:19.083Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-wasm/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:19.083Z
Learning: Applies to crates/grida-canvas-wasm/**/+(grida-canvas-wasm.js|grida-canvas-wasm.wasm) : Include WASM artifacts (`grida-canvas-wasm.js` and `grida-canvas-wasm.wasm`) in git for faster CI builds
Applied to files:
packages/grida-canvas-io/tsconfig.jsoncrates/grida-canvas-wasm/vitest.config.tscrates/grida-canvas-wasm/package.json
📚 Learning: 2025-12-20T08:11:16.220Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas/AGENTS.md:0-0
Timestamp: 2025-12-20T08:11:16.220Z
Learning: Applies to crates/grida-canvas/**/*.grida : Validate .grida files using the `tool_io_grida` CLI tool to check file structure, parse all nodes, and detect parsing errors
Applied to files:
packages/grida-canvas-io/tsconfig.jsonpackages/grida-canvas-schema/package.json
📚 Learning: 2025-12-01T00:22:19.083Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-wasm/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:19.083Z
Learning: Use the `justfile` build system for all WASM build configurations (dev, build, clean, info)
Applied to files:
packages/grida-number-input/package.json
📚 Learning: 2026-01-10T04:48:31.415Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T04:48:31.415Z
Learning: Use React.js 19 for web applications
Applied to files:
packages/grida-number-input/package.json
📚 Learning: 2025-12-01T00:22:19.083Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: crates/grida-canvas-wasm/AGENTS.md:0-0
Timestamp: 2025-12-01T00:22:19.083Z
Learning: Applies to crates/grida-canvas-wasm/**/*.{js,ts,jsx,tsx} : Use Web Workers for heavy graphics operations to improve performance and responsiveness
Applied to files:
crates/grida-canvas-wasm/package.json
📚 Learning: 2025-12-01T00:21:55.314Z
Learnt from: CR
Repo: gridaco/grida PR: 0
File: apps/docs/AGENTS.md:0-0
Timestamp: 2025-12-01T00:21:55.314Z
Learning: Run `pnpm build` after editing documentation in `/docs/` to test changes and ensure the build process copies them correctly to `apps/docs/docs/`
Applied to files:
crates/grida-canvas-wasm/package.json
🔇 Additional comments (35)
packages/react-p-queue/vitest.config.ts (1)
1-8: LGTM!Clean Vitest configuration. The
globals: truesetting aligns with the test file's usage ofvi,describe,it, andexpectwithout explicit imports, and the 10-second timeout is appropriate for async batch processing tests.packages/react-p-queue/__tests__/batch.test.ts (3)
21-27: Timer setup is correct for Vitest.Using
vi.useFakeTimers()inbeforeAllworks here since all tests require fake timers. For better test isolation, you could alternatively usebeforeEach/afterEach, but the current approach is acceptable given the uniform timer requirements across all tests.
47-47: Correct async timer API usage.Using
await vi.runAllTimersAsync()ensures that any promises triggered by timer callbacks are properly awaited before continuing.
91-96: Well-structured error handling test.Excellent refactoring. Capturing promises with
Promise.allSettledbefore running timers, then awaiting the settled results afterward, properly handles the rejection flow and avoids unhandled promise rejection warnings. This is a cleaner pattern than the original Jest approach.packages/react-p-queue/package.json (1)
22-22: Test script migration is correct for monorepo setup.The
vitest runcommand is appropriate for single-run test execution.vitest ^4is available at the root package.json level and will be used via turbo's test orchestration. If this package may be used standalone or published independently, consider addingvitestto itsdevDependenciesfor clarity and standalone usability.packages/lib/treearray/package.json (2)
27-27: LGTM.No concerns with the files array entry.
20-20: No action needed—vitest config is properly configured for this package.The package already has
vitest.config.tsin its root directory (packages/lib/treearray/vitest.config.ts), so vitest will auto-discover and use the correct configuration.packages/grida-number-input/package.json (1)
25-30: Test script migration to Vitest looks good.
Please confirm Vitest is available in the workspace toolchain (root/devDependencies) so this package’s test script resolves correctly.packages/grida-cmath/vitest.config.ts (1)
1-7: Minimal Vitest config is fine.
If any tests rely on DOM APIs, consider addingtest.environment = "jsdom"; otherwise this is good as-is.packages/grida-cmath/package.json (1)
27-31: Vitest test script update looks good.
Please confirm Vitest is available at the workspace/root level so this script resolves in CI and local runs.packages/grida-canvas-vn/package.json (1)
6-11: Vitest test script update looks good.
Please confirm Vitest is available at the workspace/root level so this script resolves in CI and local runs.packages/grida-canvas-schema/tsconfig.json (1)
3-8: TS config changes are reasonable.
Please confirm the repo’s TypeScript version/tooling supports"moduleResolution": "bundler"(TS ≥ 5) and that skipping lib checks is acceptable for this package.packages/grida-canvas-io/tsconfig.json (1)
7-8: LGTM!The migration changes are correct:
moduleResolution: "bundler"aligns with modern ESM tooling used by Vite/Vitesttypes: ["vitest/globals"]provides TypeScript support for global test APIsThis properly complements the Vitest configuration with
globals: true.packages/grida-tree/vitest.config.ts (1)
1-7: LGTM!Standard Vitest configuration consistent with the monorepo migration pattern.
packages/grida-canvas-sequence/vitest.config.ts (1)
1-7: LGTM!Standard Vitest configuration consistent with the monorepo migration pattern.
packages/grida-tokens/vitest.config.ts (1)
1-7: LGTM — Vitest globals enabled for this package.Please confirm the workspace Vitest version supports
test.globalsand that globals are intended here to avoid accidental reliance in non-test code.packages/grida-canvas-vn/vitest.config.ts (1)
1-7: LGTM — consistent Vitest config.Please verify
test.globalsmatches the intended test style and that the Vitest version in this workspace supports it.packages/grida-canvas-schema/vitest.config.ts (1)
1-7: LGTM — standard Vitest config.Please confirm
test.globalsis desired for this package and supported by the workspace Vitest version.editor/vitest.d.ts (1)
1-1: LGTM!The triple-slash reference directive correctly augments TypeScript typings with Vitest globals for the editor package.
packages/grida-canvas-sequence/tsconfig.json (1)
3-7: LGTM!The tsconfig updates align with the repository-wide Vitest migration pattern. The switch to
"moduleResolution": "bundler"is appropriate for modern bundler-based tooling, andskipLibCheck: trueimproves compilation speed.The same optional consideration about isolating Vitest types to test files applies here as noted in other packages.
packages/grida-number-input/vitest.config.ts (1)
1-7: LGTM!Clean and minimal Vitest configuration that enables global test APIs. This is consistent with the pattern used across other packages in this migration.
packages/lib/treearray/vitest.config.ts (1)
1-7: LGTM.
Minimal test config is clear and consistent.packages/grida-fonts/package.json (1)
9-9: LGTM.
Test script update is straightforward.packages/grida-tree/package.json (1)
6-6: LGTM.
Test script update is straightforward.packages/grida-tokens/package.json (1)
20-20: LGTM.
Test script update is straightforward.packages/grida-mixed-properties/package.json (1)
21-21: LGTM.
Test script update is straightforward.packages/grida-canvas-sequence/package.json (1)
21-21: LGTM - test script correctly migrated to Vitest.The change from
jesttovitest runis appropriate for CI/single-run test execution.Consider whether this package needs a
vitest.config.tsfile for consistency with other packages in this PR (e.g.,packages/grida-fonts/vitest.config.ts,packages/grida-tokens/vitest.config.ts). If the default Vitest configuration suffices, this is fine as-is.packages/grida-fonts/vitest.config.ts (1)
1-9: LGTM - Standard Vitest configuration.The configuration correctly enables globals and references the setup file for test-wide mocks. This aligns with the migration pattern used across other packages in this PR.
crates/grida-canvas-wasm/vitest.config.ts (1)
1-15: LGTM - Well-configured for WASM testing.The configuration appropriately:
- Uses ESM-compatible path resolution for the
@alias- Sets a 30-second timeout to accommodate WASM compilation and loading during tests
- Enables globals for consistent test syntax
packages/grida-number-input/tsconfig.json (1)
4-10: LGTM - TypeScript configuration updated for Vitest compatibility.The changes correctly configure the project for Vitest with globals support. The
moduleResolution: "bundler"is appropriate for modern bundler-based workflows.Note: Setting
types: ["vitest/globals"]explicitly limits type inclusion to only Vitest globals. If tests in this package require Node.js types (e.g.,Buffer,process), you may need to add"node"to the array. If the package is browser-only, this is fine as-is.packages/grida-fonts/vitest.setup.ts (1)
1-49: LGTM - Clean migration of test setup from Jest to Vitest.The setup file correctly:
- Replaces all
jest.fn()calls withvi.fn()- Uses
globalThisfor universal environment compatibility (more portable thanglobal)- Maintains comprehensive mocks for
FontFace,document.fonts,fetch, andwindow- Preserves the native
TextDecoderfor Typr library compatibilitypackages/grida-fonts/__tests__/fontface.test.ts (2)
6-19: Verify Vitest globals or importviexplicitly.This file uses the global
vi(Line 6, Line 18). Ifglobals: trueisn’t enabled in the package’s Vitest config, these tests will fail at runtime. Please confirm the config or addimport { vi } from "vitest";for safety.
35-38: Cleanup looks correct.packages/grida-fonts/__tests__/fontface-dom.test.ts (2)
29-33: Mock resets are fine.
56-58: Spy usage is appropriate.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
…pdate README files to remove outdated information, and enhance test cases for font handling
Tests
Chores
Documentation