Skip to content

Run every frontend unit test - #300

Closed
eas4ai wants to merge 1 commit into
dev-null-sh:productionfrom
eas4ai:fix/run-all-react-tests
Closed

eas4ai wants to merge 1 commit into
dev-null-sh:productionfrom
eas4ai:fix/run-all-react-tests

Conversation

@eas4ai

@eas4ai eas4ai commented Oct 16, 2026

Copy link
Copy Markdown

Problem

bun run test:unit only selected top-level *.test.ts files. A wrapper then started a second test runner for three named TSX suites.

That left ten React test files out of the normal unit-test command. The test TypeScript project also included only one TSX suite, so the other files were not type-checked.

Changes

  • Use one Vite+ command to discover every tests/Unit/**/*.test.ts and *.test.tsx file.
  • Replace the three-file config with tests/unit.config.ts and remove the nested runner.
  • Use the same vite-plus/test API in every frontend suite.
  • Include every unit test and the application declaration files in tests/tsconfig.json.
  • Update three stale fixtures that failed once the omitted suites actually ran.

No production files or test assertions changed.

Regression proof

Before the fix, I added a deliberate failure to the omitted CommitThread.test.tsx suite. The old command stayed green because it did not discover that file.

With the unified runner, the same command found and failed the deliberate test. I then removed the sentinel and ran the final checks below.

Verification

  • bun run test:unit — 16 files, 89 tests passed
  • bun run test:types
  • bun run test:lint
  • bun run build
  • composer test:lint
  • composer test:types
  • composer test:type-coverage — 100%
  • git diff --check
  • Independent read-only review — ready to merge, no findings

The full composer test:unit command was not run locally because it requires the PostgreSQL extensions and coverage driver provided by GitHub Actions. Its frontend step was run directly as bun run test:unit.

Risk

This changes test discovery and test fixtures only. The main expected effect is that CI now runs all frontend unit tests instead of a partial allowlist.

@xHeaven

xHeaven commented Oct 18, 2026

Copy link
Copy Markdown
Member

@nunomaduro This PR touches test configuration. Could you take a look?

@SanderMuller

Copy link
Copy Markdown
Contributor

I hit the same gap and was about to open a PR for it, so thanks for this one. It now conflicts with production in 6 files: tsconfig.json, unit.config.ts, and the CommitImages, ComposerPreview, LinkifiedText and QuotedCommit tests.

After the rebase, I expect two fixtures to need one more field each. Commit now has a required mentions and User a required timezone, so the NotificationInbox commit needs mentions: {} and the CommitImages user needs timezone: null. I found these on my own branch from current production, not on yours.

@hbenabdallah

Copy link
Copy Markdown
Contributor

#492 does the same thing (runs the TSX component tests in CI). Worth keeping just one of the two.

Copy link
Copy Markdown
Member

Closing as superseded: #1220 (merged as 85376fd, "test: run and typecheck every tsx unit test") now runs every tests/Unit TSX suite in the normal unit-test command and type-checks them, which is what this PR set out to do. Thanks for spotting the gap!

@nunomaduro nunomaduro closed this Oct 27, 2026
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.

5 participants