Skip to content

chore: jest => vitest#496

Merged
softmarshmallow merged 3 commits intomainfrom
canary
Jan 16, 2026
Merged

chore: jest => vitest#496
softmarshmallow merged 3 commits intomainfrom
canary

Conversation

@softmarshmallow
Copy link
Copy Markdown
Member

@softmarshmallow softmarshmallow commented Jan 16, 2026

  • Tests

    • Migrated test runner from Jest to Vitest across the repo; updated test setups, timers, and timeouts to match Vitest.
  • Chores

    • Updated TypeScript configs for bundler resolution and Vitest typings; removed Jest tooling and adjusted test scripts.
  • Documentation

    • Added a CSS README subsection with repository snapshot counts and cleaned up some test-runner docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 16, 2026 2:17am
grida Ready Ready Preview, Comment Jan 16, 2026 2:17am
5 Skipped Deployments
Project Deployment Review Updated (UTC)
code Ignored Ignored Jan 16, 2026 2:17am
legacy Ignored Ignored Jan 16, 2026 2:17am
backgrounds Skipped Skipped Jan 16, 2026 2:17am
blog Skipped Skipped Jan 16, 2026 2:17am
viewer Skipped Skipped Jan 16, 2026 2:17am

Review with Vercel Agent

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 16, 2026

Walkthrough

Migrates 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

Cohort / File(s) Summary
Root & Docs
.ref/css/README.md
Added a "Misc" subsection documenting repository snapshot counts (informational only).
Workspace root
package.json
Removed devDependencies for Jest (jest, @types/jest, ts-jest).
Editor types
editor/vitest.d.ts
Added Vitest globals Triple-Slash types reference.
crates/grida-canvas-wasm
crates/grida-canvas-wasm/jest.config.ts, crates/grida-canvas-wasm/package.json, crates/grida-canvas-wasm/vitest.config.ts, crates/grida-canvas-wasm/lib/__test__/README.md
Deleted Jest config. Switched test script to vitest run. Added Vitest config with @ alias and 30000ms timeout. Minor README bullet removals.
packages/*: Jest→Vitest script changes
packages/*/package.json (many packages: grida-canvas-sequence, grida-cmath, grida-fonts, grida-mixed-properties, grida-number-input, grida-tokens, grida-tree, react-p-queue, lib/treearray, grida-canvas-vn, grida-canvas-schema, ...)
Updated test scripts from jest to vitest run and removed embedded Jest config blocks where present.
Per-package Vitest configs
packages/*/vitest.config.ts, packages/lib/treearray/vitest.config.ts, crates/.../vitest.config.ts (added across listed packages)
Added Vitest configuration files (typically test.globals = true, some with timeouts or setupFiles).
tsconfig changes
packages/*/tsconfig.json, packages/grida-canvas-io-figma/tsconfig.json, crates/...
Switched moduleResolution to bundler, added "types": ["vitest/globals"] and skipLibCheck where applied; some packages added target/module updates.
Removed per-package Jest configs
packages/*/jest.config.ts, crates/*/jest.config.ts
Deleted various Jest config files across packages.
Test code & setup migrations
packages/grida-fonts/vitest.setup.ts, packages/grida-fonts/__tests__/*.test.ts, packages/grida-canvas-io/__tests__/clipboard.test.ts, packages/react-p-queue/__tests__/batch.test.ts, editor/.../apply-scale.roundtrip.test.ts, packages/grida-fonts/__tests__/typr.test.ts, packages/grida-canvas-vn/__tests__/vn.test.ts, ...
Replaced Jest APIs with Vitest (jest.*vi.*), adapted fake-timer APIs to async variants, switched mocks to vi.fn(), migrated globals to globalThis, relaxed or adjusted some test assertions/typings and timeouts, and replaced local deepClone with structuredClone in tests.
Misc tests/docs cleanup
packages/grida-canvas-io/__tests__/README.md
Removed "Using other test runners" subsection from README.

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

org

Poem

🐰 I hopped through configs, tidy and spry,

Swapped jest for vitest with a twinkle in eye.
vi.fn() for whiskers, globalThis for the sun,
Tests spring to life — a carrot-run begun! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title directly and accurately summarizes the main change: migrating the test framework from Jest to Vitest across the entire codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch canary

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…le packages, updating configurations and scripts accordingly
@softmarshmallow softmarshmallow marked this pull request as ready for review January 16, 2026 02:01
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in fontface.test.ts: confirm vi globals or add explicit import.

🧹 Nitpick comments (7)
packages/grida-canvas-schema/package.json (1)

7-7: vitest is available but not declared locally.

The test script references vitest run, and while vitest ^4 is available at the workspace root, it's not explicitly listed in this package's devDependencies. In a monorepo with hoisting, this is functional but adds friction if the package needs to run independently. Consider adding vitest as a devDependency here for clarity.

packages/grida-canvas-io/__tests__/clipboard.test.ts (2)

7-38: Prefer satisfies/explicit typing over as unknown as to 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 restoring satisfies (or an explicit type annotation) to keep type-checking meaningful. Please confirm the repo’s TypeScript version supports satisfies (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: Avoid as unknown as on largePrototype to 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 using satisfies (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" and types: ["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 note skipLibCheck can 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.json that extends the base config and adds the Vitest types, or configure the include array 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0166de2 and d18a14c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (43)
  • .ref/css/README.md
  • crates/grida-canvas-wasm/jest.config.ts
  • crates/grida-canvas-wasm/package.json
  • crates/grida-canvas-wasm/vitest.config.ts
  • editor/vitest.d.ts
  • package.json
  • packages/grida-canvas-io-figma/tsconfig.json
  • packages/grida-canvas-io/__tests__/clipboard.test.ts
  • packages/grida-canvas-io/tsconfig.json
  • packages/grida-canvas-schema/jest.config.ts
  • packages/grida-canvas-schema/package.json
  • packages/grida-canvas-schema/tsconfig.json
  • packages/grida-canvas-schema/vitest.config.ts
  • packages/grida-canvas-sequence/package.json
  • packages/grida-canvas-sequence/tsconfig.json
  • packages/grida-canvas-sequence/vitest.config.ts
  • packages/grida-canvas-vn/jest.config.ts
  • packages/grida-canvas-vn/package.json
  • packages/grida-canvas-vn/tsconfig.json
  • packages/grida-canvas-vn/vitest.config.ts
  • packages/grida-cmath/package.json
  • packages/grida-cmath/vitest.config.ts
  • packages/grida-fonts/__tests__/fontface-dom.test.ts
  • packages/grida-fonts/__tests__/fontface.test.ts
  • packages/grida-fonts/jest.config.ts
  • packages/grida-fonts/package.json
  • packages/grida-fonts/tsconfig.json
  • packages/grida-fonts/vitest.config.ts
  • packages/grida-fonts/vitest.setup.ts
  • packages/grida-mixed-properties/package.json
  • packages/grida-mixed-properties/vitest.config.ts
  • packages/grida-number-input/package.json
  • packages/grida-number-input/tsconfig.json
  • packages/grida-number-input/vitest.config.ts
  • packages/grida-tokens/package.json
  • packages/grida-tokens/vitest.config.ts
  • packages/grida-tree/package.json
  • packages/grida-tree/vitest.config.ts
  • packages/lib/treearray/package.json
  • packages/lib/treearray/vitest.config.ts
  • packages/react-p-queue/__tests__/batch.test.ts
  • packages/react-p-queue/package.json
  • packages/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.json
  • packages/grida-fonts/vitest.setup.ts
  • crates/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.json
  • packages/grida-canvas-vn/vitest.config.ts
  • packages/grida-tree/vitest.config.ts
  • packages/grida-tokens/package.json
  • packages/grida-canvas-io/tsconfig.json
  • crates/grida-canvas-wasm/vitest.config.ts
  • packages/grida-number-input/vitest.config.ts
  • packages/grida-fonts/vitest.setup.ts
  • packages/grida-canvas-schema/package.json
  • packages/grida-canvas-vn/package.json
  • packages/grida-canvas-vn/tsconfig.json
  • packages/grida-tokens/vitest.config.ts
  • packages/grida-canvas-sequence/package.json
  • packages/grida-tree/package.json
  • packages/grida-number-input/tsconfig.json
  • packages/grida-cmath/vitest.config.ts
  • packages/grida-canvas-io/__tests__/clipboard.test.ts
  • packages/grida-cmath/package.json
  • crates/grida-canvas-wasm/package.json
  • packages/grida-canvas-sequence/vitest.config.ts
  • packages/grida-canvas-sequence/tsconfig.json
  • packages/grida-mixed-properties/vitest.config.ts
  • packages/grida-canvas-schema/vitest.config.ts
  • editor/vitest.d.ts
  • packages/grida-canvas-schema/tsconfig.json
  • packages/grida-canvas-io-figma/tsconfig.json
  • packages/grida-fonts/tsconfig.json
  • packages/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.json
  • packages/lib/treearray/package.json
  • packages/react-p-queue/package.json
  • packages/grida-tokens/package.json
  • packages/grida-mixed-properties/package.json
  • packages/grida-canvas-vn/package.json
  • packages/grida-canvas-sequence/package.json
  • packages/grida-number-input/package.json
  • packages/grida-cmath/package.json
  • crates/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.json
  • packages/grida-canvas-vn/vitest.config.ts
  • packages/lib/treearray/package.json
  • packages/react-p-queue/package.json
  • packages/grida-tokens/package.json
  • packages/grida-mixed-properties/package.json
  • packages/grida-canvas-io/tsconfig.json
  • packages/grida-canvas-schema/package.json
  • packages/grida-canvas-vn/package.json
  • packages/grida-canvas-vn/tsconfig.json
  • packages/grida-canvas-sequence/package.json
  • packages/grida-number-input/tsconfig.json
  • packages/grida-number-input/package.json
  • packages/grida-cmath/package.json
  • packages/grida-canvas-sequence/tsconfig.json
  • editor/vitest.d.ts
  • packages/grida-canvas-schema/tsconfig.json
  • packages/grida-canvas-io-figma/tsconfig.json
  • packages/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.json
  • packages/grida-canvas-sequence/package.json
  • 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: 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.json
  • packages/grida-tokens/package.json
  • packages/grida-canvas-vn/package.json
  • packages/grida-cmath/package.json
  • crates/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.ts
  • packages/grida-fonts/vitest.setup.ts
  • packages/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.ts
  • packages/grida-fonts/vitest.setup.ts
  • packages/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.json
  • crates/grida-canvas-wasm/vitest.config.ts
  • crates/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.json
  • packages/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: true setting aligns with the test file's usage of vi, describe, it, and expect without 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() in beforeAll works here since all tests require fake timers. For better test isolation, you could alternatively use beforeEach/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.allSettled before 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 run command is appropriate for single-run test execution. vitest ^4 is 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 adding vitest to its devDependencies for 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.ts in 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 adding test.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/Vitest
  • types: ["vitest/globals"] provides TypeScript support for global test APIs

This 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.globals and 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.globals matches 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.globals is 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, and skipLibCheck: true improves 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 jest to vitest run is appropriate for CI/single-run test execution.

Consider whether this package needs a vitest.config.ts file 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 with vi.fn()
  • Uses globalThis for universal environment compatibility (more portable than global)
  • Maintains comprehensive mocks for FontFace, document.fonts, fetch, and window
  • Preserves the native TextDecoder for Typr library compatibility
packages/grida-fonts/__tests__/fontface.test.ts (2)

6-19: Verify Vitest globals or import vi explicitly.

This file uses the global vi (Line 6, Line 18). If globals: true isn’t enabled in the package’s Vitest config, these tests will fail at runtime. Please confirm the config or add import { 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.

Comment thread packages/grida-mixed-properties/vitest.config.ts
…pdate README files to remove outdated information, and enhance test cases for font handling
@vercel vercel Bot temporarily deployed to Preview – backgrounds January 16, 2026 02:13 Inactive
@vercel vercel Bot temporarily deployed to Preview – blog January 16, 2026 02:13 Inactive
@vercel vercel Bot temporarily deployed to Preview – viewer January 16, 2026 02:13 Inactive
@softmarshmallow softmarshmallow merged commit 9d0cb4f into main Jan 16, 2026
10 checks passed
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.

1 participant