Skip to content

dev: add fast-unit test scripts excluding example tests#2746

Open
Dotims wants to merge 2 commits into
software-mansion:mainfrom
Dotims:feature/fast-unit-scripts
Open

dev: add fast-unit test scripts excluding example tests#2746
Dotims wants to merge 2 commits into
software-mansion:mainfrom
Dotims:feature/fast-unit-scripts

Conversation

@Dotims

@Dotims Dotims commented Jul 20, 2026

Copy link
Copy Markdown

What

Adds test:fast-unit and test:fast-unit-watch to the root package.json.
They run the unit tests but exclude the example tests in
apps/typegpu-docs/tests/individual-example-tests, for a faster local loop.

Closes #1638

Note on the approach

The issue suggests handling this like the browser tests (by project). On
Vitest 4, though, the inner individual-example-tests project defined in
apps/typegpu-docs/vitest.config.mts is not addressable from the monorepo
root: when that config is pulled in via the root projects: ['apps/*'], its
nested test.projects is not re-expanded, so the example tests run under the
typegpu-docs project and --project=!individual-example-tests is a no-op.

I excluded them by path instead: --exclude '**/individual-example-tests/**'.
apps/typegpu-docs has no other node tests, so nothing else is affected.

Result: test:fast-unit runs 2508 tests across 192 files (vs 2567 / 251 with
the examples) and is noticeably faster.

Happy to instead restructure the config so the example tests become a
root-addressable project (then --project=!individual-example-tests) if you
prefer that.

Side note (out of scope for this PR)

--project=!browser in the existing scripts also looks like a no-op from the
root, and test:browser (--project browser) errors with "No projects
matched" when run from the root. Possibly fallout from the Vitest 3->4 upgrade.

test:fast-unit and test:fast-unit-watch run unit tests while excluding apps/typegpu-docs/tests/individual-example-tests. The example-tests project is not addressable by name from the monorepo root under Vitest 4, so exclusion is done by path.
Copilot AI review requested due to automatic review settings July 20, 2026 14:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new root-level Vitest scripts intended to speed up local unit-test runs by excluding the apps/typegpu-docs/tests/individual-example-tests suite, addressing issue #1638.

Changes:

  • Add test:fast-unit to run unit tests while excluding **/individual-example-tests/**.
  • Add test:fast-unit-watch to run the same filtered set in watch mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes — adds test:fast-unit and test:fast-unit-watch scripts to the root package.json that skip the example snapshot tests in apps/typegpu-docs/tests/individual-example-tests, giving a faster local unit-test loop.

  • Add test:fast-unit — runs the non-browser unit tests while excluding the example tests.
  • Add test:fast-unit-watch — watch-mode equivalent of the above.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread package.json
Comment thread package.json Outdated
Comment thread package.json Outdated

@iwoplaza iwoplaza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot! 💜

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.

dev: Create a separate set of scripts for running unit tests excluding example tests

3 participants