Repository navigation
test(bundle): share the config-probe, comment and request-sequence helpers across bundle suites - #273
Merged
Merged
Conversation
…lpers across bundle suites bundle.test.ts, triggerTestAndLgtmCancel.test.ts and collaborationCommands.test.ts each declared their own copies; __tests__/bundle/helpers.ts now exports the ones at least two of them use: repo, token, comment(), configReads(), ownersReads, ownersProbe, queueRead and membershipReads(), plus calls(), expectRequests(), expectCommandThenConfig() and routeOwners() bound to a suite's fake through helpersFor(() => gh). The trigger suite's expectCommandThenConfig() was the general form of bundle.test.ts's expectCommandThenSweep(), so the two are now one helper. Test names and counts are unchanged (125 bundle tests, 1556 in all). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Signed-off-by: Jeffrey Sica <me@jeefy.dev>
Contributor
|
Please add a kind label with |
This was referenced Oct 3, 2026
This was referenced Oct 4, 2026
Merged
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.
Description
bundle.test.ts,triggerTestAndLgtmCancel.test.tsandcollaborationCommands.test.tseach declared their own copies of the same helpers. They now import them from__tests__/bundle/helpers.ts. It exports only the helpers that at least two of these suites use, each with the signature of the most general existing copy:repo,tokencomment(body, author?): theissue_commentpayload on issue Bump acorn from 5.7.3 to 5.7.4 #1configReads({ org?, repo? }): the loader's 10 configuration probes (org.project/.githubprow.yaml, then the 8 repo paths), stopping where a tier's file is foundownersReads,ownersProbe,queueRead,membershipReads(login)helpersFor(() => gh)returnscalls(),expectRequests(reads, rest),expectCommandThenConfig(command, tail?, commandReads?)androuteOwners(ownersFiles, files, pull?). These act on the suite's fake GitHub. They take a getter because the suite binds them beforebeforeAllstarts the fake.bundle.test.ts'sexpectCommandThenSweepwas the trigger suite'sexpectCommandThenConfigwith nocommandReads, so the two are now one helper. The collaboration suite's three-readmembershipReadsis renamedmembershipOrCommentReadsand built on the shared two-readmembershipReads.The open bundle-test PRs (#242, #244, #246, #250, #252, #260, #262, #270) can import from here instead of copying these.
repoLabels,yamlFile,openPr,forkPr,routeListandlabelsReadstay inbundle.test.tsbecause only that suite uses them. Move them tohelpers.tswhen a second suite needs one.Testing
npx vitest run __tests__/bundlepasses 125 tests both before and after the change (88 + 21 + 14 + 2). The fullnpm testpasses 1556, with test names identical tomain.main, except the three formerexpectCommandThenSweepcallers. Each now also runs the emptycommandReadscheck ([]equals[]).npm run lintreports no new findings.src/ordist/changes. Net change is −24 lines.