test(dx): headless API test runner, unit-test aggregate, typecheck, CI (TODO 15) - #123
Closed
lopugit wants to merge 2 commits into
Closed
test(dx): headless API test runner, unit-test aggregate, typecheck, CI (TODO 15)#123lopugit wants to merge 2 commits into
lopugit wants to merge 2 commits into
Conversation
…I (TODO 15) The 226-test API suite only ran from the interactive /tests page, four node --test unit suites had no aggregate, there was no typecheck script, and no CI. Adds the ratchet's runnable core: - scripts/run-api-tests.mjs: headless HTTP runner that reuses the SAME canonical apiTests.ts + apiTestRunner.ts the browser uses (one source of truth). Shims window.setTimeout/clearTimeout and resolves the app's relative fetch paths against a --base origin. Flags: --base, --group (repeatable), --all (include mutating/email tests, off by default so a bare run is read-only), --json. Exits non-zero on failure. - scripts/ts-alias-loader.mjs + register-ts-hook.mjs: a tiny ESM resolve hook (~/ alias + extensionless .ts) so plain node can run the TS test modules. This ALSO fixes the previously-broken test:editorjs suite, which failed on main because node --test couldn't resolve editorJsValue.ts's extensionless './inlineHtmlText' import. - package.json: typecheck (tsc --noEmit), test (runs all four unit suites), test:api; the four test:* suites now load the resolve hook. - .github/workflows/ci.yml: PR + push-to-main gate — pnpm install, unit tests, build:client. Typecheck runs non-blocking (tsc currently reports ~121 baseline errors, strict off — a number to ratchet down). Verified locally: npm run test → 87/87 across 4 suites, exit 0; run-api-tests against a live dev server → 224/226 (the 2 are per-IP rate-limit 429s from repeated local runs, not real failures); build:client succeeds; typecheck exits 2 as expected (non-blocking). Deferred (called out in TODO 15, not in this PR): enabling tsc strictness, unifying the drifted ThingtimeTypes interfaces, finishing the Commander V1->V2 migration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Comment on lines
+21
to
+53
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: remix | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.12.1 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| # Node >= 23.6 runs the repo's `node --test *.test.ts` suites | ||
| # directly (TypeScript type-stripping on by default). | ||
| node-version: 24 | ||
| cache: pnpm | ||
| cache-dependency-path: remix/pnpm-lock.yaml | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Unit tests | ||
| run: npm run test | ||
|
|
||
| - name: Typecheck (non-blocking) | ||
| continue-on-error: true | ||
| run: npm run typecheck | ||
|
|
||
| - name: Build client shell | ||
| run: npm run build:client |
Contributor
|
Conflicted files (as recorded by the merge step):
|
Contributor
|
Conflicted files (as recorded by the merge step):
|
lopugit
added a commit
that referenced
this pull request
Jul 29, 2026
…te, single Web CI Absorbs the best of the parallel PRs #119, #123, and #126 into this branch (#121), so one PR carries TODO item 15: - typecheck ratchet (from #126): scripts/typecheck-ratchet.mjs + typecheck-baseline.json (134 errors today) — CI fails only when the tsc error count grows, and --update-baseline locks in reductions. - test:unit aggregate (from #119/#123), with the node --test suites loading through tsx instead of a hand-rolled resolve hook — fixes the previously broken ~/-alias suites and adds the scriptless mongodb/*.test.ts suite (109 unit tests, all passing). - runner --list flag (parity with the other runners). - TODO.md item-15 status note (from #123, updated). - one workflow: api-tests.yml + the others' ci.yml variants become web-ci.yml — build + ratchet + unit tests, plus the headless 243-test API suite against a real Vite + Nitro + Mongo stack; path-filtered to remix/**, read-only token, node 24. Verified locally: ratchet at baseline, 109/109 unit tests, 243/243 API tests against a live dev stack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ships the runnable core of TODO 15 — 🛠️ DX ratchet: add typecheck, a headless test runner, and CI.
What
scripts/run-api-tests.mjsapiTests.ts+apiTestRunner.tsthe interactive/testspage uses — one source of truth. Shimswindow.setTimeout/clearTimeoutand resolves the app's relative fetch paths against--base.scripts/ts-alias-loader.mjs+register-ts-hook.mjs~/alias + extensionless.ts) so plainnoderuns the TS test modules.package.jsontypecheck(tsc --noEmit),test(all four unit suites),test:api; the fourtest:*suites now load the hook..github/workflows/ci.ymlbuild:client. Typecheck runs non-blocking.Runner flags
--base <url>·--group <g>(repeatable) ·--all(include mutating/email tests — off by default so a bare run is read-only) ·--json. Exits non-zero on any failure.Bonus fix
The hook also fixes the previously-broken
test:editorjssuite, which failed onmainbecausenode --testcouldn't resolveeditorJsValue.ts's extensionless./inlineHtmlTextimport.npm run testwas red on main; it's green now.Why typecheck is non-blocking
tsc --noEmitcurrently reports ~121 errors (strict mode is off intsconfig). The step surfaces the count so it can be ratcheted down over time rather than blocking every PR on a pre-existing backlog — exactly the TODO's "progressively enable strictness" intent.Verification (local)
npm run test→ 87/87 across the 4 unit suites, exit 0run-api-tests.mjsagainst a live dev server → 224/226 (the 2 are per-IP rate-limit429s from my repeated runs — the runner correctly exercises the real limiter, not real failures)npm run build:client→ succeedsnpm run typecheck→ exit 2 (expected; non-blocking in CI)--jsonoutput and--groupfilter verifiedDeferred (explicitly out of scope, noted in TODO 15)
Enabling tsc strictness, unifying the two drifted
ThingtimeTypesinterfaces, and finishing the Commander V1→V2 migration — each is its own change. The API runner is not run in CI (needs a live server + MongoDB); it's a local/staging tool.Session 3 of 10 parallel todo sessions (previous: #94, #102, #105, #112, #117); claim branch pushed before work started.
🤖 Generated with Claude Code