Skip to content

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Jan 16, 2026

Running all of the unit tests is sloooow. By using turbo, like we do for builds, it can be much faster. Since it kind of sucks to not get any output while waiting for tests to pass, also moves the "quiet" mode to its own script. This should be used with agents for possible context savings.

Summary

  • Add test:dev and test:dev:quiet tasks to Turborepo for cached local testing
  • test:dev runs with full output for debugging
  • test:dev:quiet uses dot reporter and --output-logs=errors-only for token-efficient AI workflows
  • Add passWithNoTests: true to vitest configs for packages without tests
  • Fix @metamask/streams tests to pass in dev mode by removing unnecessary coupling between environment choice and endoify setup

Details

Turborepo Caching

Both test:dev and test:dev:quiet tasks depend on ^build and enable caching of per-package tests. Subsequent runs without code changes will hit the cache.

Test commands:

  • yarn test:dev - Full turbo output with verbose test results
  • yarn test:dev:quiet - Only shows output from failing packages, uses dot reporter

Streams Fix

The streams vitest.config.ts was coupling two unrelated concerns:

  • Environment: jsdom (dev) vs browser/Playwright (test)
  • Endoify: mock (dev) vs real (test)

The mock-endoify setup doesn't actually freeze objects, causing Object.isFrozen() assertions to fail in dev mode. By using real endoify.js and browser/Playwright in both modes, tests now pass consistently.

🤖 Generated with Claude Code

@rekmarks rekmarks requested a review from a team as a code owner January 16, 2026 00:11
rekmarks and others added 4 commits January 15, 2026 16:51
- Add test:dev task to turbo.json with ^build dependency
- Update root test:dev script to use turbo with --output-logs=errors-only
- Add passWithNoTests to vitest configs for packages without tests

Co-Authored-By: Claude <[email protected]>
Remove unnecessary coupling between environment choice (jsdom vs browser) and
endoify setup (mock vs real). Use real endoify.js in both dev and prod modes,
only varying the environment. This fixes Object.isFrozen() assertions that were
failing in dev mode due to mock-endoify's no-op harden() implementation.

Co-Authored-By: Claude <[email protected]>
- Remove --output-logs=errors-only from default test:dev script
- Add 'Running tests' section to README documenting test commands
- Document how to suppress output with --output-logs=errors-only flag

Co-Authored-By: Claude <[email protected]>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

sirtimid
sirtimid previously approved these changes Jan 16, 2026
Copy link
Contributor

@sirtimid sirtimid left a comment

Choose a reason for hiding this comment

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

LGTM

rekmarks and others added 2 commits January 15, 2026 21:13
Adds a test:dev:quiet script across all packages that uses the dot
reporter for compact output. The root script also uses turbo's
--output-logs=errors-only flag to only show output from failing tasks.

This is useful for AI-assisted workflows where token efficiency matters.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

4 participants