Skip to content

test: run the ten component tests that CI never ran - #492

Closed
jubianchi wants to merge 3 commits into
dev-null-sh:productionfrom
jubianchi:test/run-component-tests-in-ci
Closed

jubianchi wants to merge 3 commits into
dev-null-sh:productionfrom
jubianchi:test/run-component-tests-in-ci

Conversation

@jubianchi

@jubianchi jubianchi commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Ten of the seventeen tests/Unit/*.test.tsx files import test from node:test and contain JSX. The test:unit script only runs node --test tests/Unit/*.test.ts, which matches neither .tsx nor JSX, so they have never run in CI. The other seven already run under the Vite runner through tests/draft-images.config.ts.

Left unrun, they drifted: 3 cases fail on a stale fixture, and 4 type errors hide in two files.

Changes

  1. Fixtures: the three files get the fields their components now expect.
  2. Runner: the ten files import test from vite-plus/test (and drop the now-meaningless void before test()); the Vite config and the tests tsconfig pick up every .tsx test by glob.
  3. resources/scripts/tsconfig.json: brand-wallpapers.ts belonged to no TypeScript project, and the type-aware lint picked one for it depending on the size of the others. With the tests project grown, it lost Node's types and the lint failed. Seven lines give the script its own project.

Result

Before After
Vite runner 7 files, 36 cases 17 files, 119 cases
tsc on the tests 2 .tsx files all 17
vp lint 3 warnings 3 warnings

Not included: renaming draft-images.config.ts and SeriesStash.test.ts, which no longer describe what they run. Happy to follow up if you'd like.

@jubianchi
jubianchi force-pushed the test/run-component-tests-in-ci branch from 6b8ddbe to 96109b9 Compare October 18, 2026 19:33
Three of the component tests written for node:test built their commits and users before fields they now need: the thread test lacked preview_segments, so FoldedCommitBody had nothing to map; the images test's user lacked timezone; the inbox test's commit lacked hot_score, mentions and pasteis_count. None of this showed, because these tests run nowhere yet. The fixtures now carry the fields, so the next commit can make them run and type-check.

🤖 Generated with Claude Code
…nner

Ten component tests import test from node:test and contain JSX. The test:unit script runs node --test over tests/Unit/*.test.ts, which neither matches .tsx files nor parses JSX, so they have run nowhere since the day they were written, and only bun test, which is not the project's runner, could execute them. The seven other .tsx tests already run under the Vite runner, listed by name in the config that SeriesStash.test.ts launches from node --test. These ten now import test from vite-plus/test, and lose the void before their test() calls, which Vitest's test() returning nothing made meaningless and the linter flagged one by one. Both the Vite config and the tests tsconfig take every .tsx test by glob, so nothing has to be registered by hand again. The Vite run goes from 7 files and 36 cases to 17 files and 119, all green after the previous commit's fixtures, and tsc now covers all seventeen. The formatter was run over the touched files to sort their imports.

🤖 Generated with Claude Code
resources/scripts/brand-wallpapers.ts belonged to no tsconfig: the root one includes resources/js only and the tests one includes tests. The type-aware lint then picks a program for it by heuristics, and that pick changes with the size of the other projects: once the tests project takes every component test, the script is checked without Node's types and the lint fails on node:fs, process and import.meta.dirname, while nothing in the script changed. A tsconfig of its own, extending the root one with Node's types, settles which program checks it; tsc --project resources/scripts/tsconfig.json passes.

🤖 Generated with Claude Code
@hbenabdallah

Copy link
Copy Markdown
Contributor

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

@jubianchi

Copy link
Copy Markdown
Contributor Author

@hbenabdallah good catch! closing this one.

Thanks

@jubianchi jubianchi closed this Oct 20, 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.

2 participants