test: migrate tests to cross-runtime node:test#11
Closed
BottieMcBotface wants to merge 3 commits intomainfrom
Closed
test: migrate tests to cross-runtime node:test#11BottieMcBotface wants to merge 3 commits intomainfrom
BottieMcBotface wants to merge 3 commits intomainfrom
Conversation
Rename *.bun.test.ts to *.test.ts across the test suite and replace bun:test imports with node:test plus @std/expect. Add src/test/testlib.ts and src/test/cleanup.ts as a small shim on top of node:test so tests with afterEach / beforeEach still compose correctly. Update package.json with the cross-runtime check/test scripts, and wire @std/assert / @std/expect into both the npm devDependencies and the deno.jsonc imports map. Mechanical migration only. No behavior changes, no feature work. Unblocks the wait-for rebuild (PRs 2-4). --- Agent: axhxrx-engineer agent Model: claude-opus-4-7[1m]
P1: update .github/workflows/ci.yml to reference the renamed examples/runtime-matrix.test.ts (was examples/runtime-matrix.bun.test.ts) in both the path-ignore-patterns and the dedicated matrix step. P2: split the package.json "test" script so the fast Bun suite ignores the runtime matrix and the heavy matrix runs separately with the same --timeout/--max-concurrency knobs CI already uses. Avoids flakiness. P2: rework deno.jsonc excludes. Drop the stale *.bun.test.ts / *.bun.ts patterns and add a publish.exclude that filters src/test/ and **/*.test.ts so no test sources leak into the JSR distributable. Verified with deno publish --dry-run. --- Agent: axhxrx-engineer agent Model: claude-opus-4-7[1m]
--- Agent: axhxrx-engineer agent Model: claude-opus-4-7[1m]
Contributor
|
This one looks like the 🤖🤖🤖 went off the rails a little bit, so I don't want to bother reviewing this. I'm just gonna close it. I'll take a look myself later; might let them take another crack at it after giving them a couple clean examples. |
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.
Summary
Migrate every
*.bun.test.tsfile in this repo to*.test.tsusingnode:testplus@std/expect, so the test suite runs under Bun, Deno, and Node 24+ from one set of source files. Pure mechanical migration, no feature work.What's in scope
*.bun.test.tsfiles to*.test.ts:examples/runtime-matrix.test.tssrc/fs/getFileInfo.test.tssrc/gh/gh.test.tssrc/git/git.test.tssrc/script/FileLogging.test.tssrc/script/OutputContext.test.tssrc/script/Script.test.tssrc/script/parseScriptArgs.test.tssrc/script/splitCommandLines.test.tssrc/sh/run.test.tssrc/utils/utils.test.tstools/getPathToRepoRoot.test.tsimport { test } from 'bun:test'withnode:test(or the local shim) andimport { expect } from '@std/expect'.src/test/testlib.ts: a small shim on top ofnode:testthat addsdescribe/beforeEach/afterEachsemantics with sequential scheduling so the existing cleanup-heavy test files keep working.src/test/cleanup.ts: thewithCleanup()helper used by the new tests.package.json: add@std/assertand@std/expectas devDependencies (via the@jsr/std__assert/@jsr/std__expectbridge), add thecheck/fix/testscripts. Thetestscript splits the fast Bun suite from the heavy runtime-matrix suite using the same--timeout 30000 --max-concurrency 1knobs CI already uses.deno.jsonc: add@std/assertand@std/expectto the imports map, drop the stale*.bun.test.ts/*.bun.tsexclude + check.exclude blocks, and addpublish.excludewithsrc/testand**/*.test.tsso no test sources ship to JSR..github/workflows/ci.yml: update both Bun test steps to reference the renamedexamples/runtime-matrix.test.ts.What's out of scope
This PR is intentionally narrow. It unblocks the wait-for rebuild (PRs 2-4), but does not touch:
src/wait/.src/utils/groupArgs.ts/groupArgs.demo.ts— those move to@axhxrx/argsin PR 2.claude-summarize.demo.*— can come in a later PR if wanted.wait-for.ts/wait-for.test.ts/wait-for.spec.md— those move to@axhxrx/wait-forin PR 4.Verification
Verified in a fresh off-tree directory (outside the megarepo workspace) to avoid this session's worktree-specific Deno workspace and Bun hoisting quirks:
bun run test— 207 / 207 pass (Bun + Deno + Node, run sequentially).bun run check—deno check && deno lint && bun tsc --noEmit && dprint checkall clean. 61 files checked.deno publish --dry-run --allow-dirty— no*.test.tsfiles and nosrc/test/files ship to JSR.Code review (via
bun review/main.ts run) round 2 returned no actionable findings after the three round-1 issues (CI workflow paths, default Bun test script, Deno publish excludes) were fixed.