Repository navigation
test(remove): assert every DELETE the /remove happy paths issue; enable test/expect-expect - #512
Conversation
…le test/expect-expect remove.test.ts 'removes the specified label' and 'removes multiple labels' registered the DELETE handlers but asserted nothing, so a /remove that dropped all labels but the first passed the file. Each DELETE now carries an ObserveRequest whose called() is awaited, and setFailed is asserted silent. eslint.config.mjs turns on @vitest/eslint-plugin's test/expect-expect for __tests__/**/*.test.ts with this suite's assertion helpers whitelisted (expect*, *.called, *.notCalled); on main it flags exactly these two tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
|
Please add a kind label with |
mrbobbytables
left a comment
There was a problem hiding this comment.
Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.
Both /remove success cases now observe every DELETE and assert no action failure. The scoped expect-expect lint rule recognizes the existing request-observer assertion helpers.
Verified successful build-test, e2e-coverage and DCO results on head d420b9f. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
Test Improvement
Files:
__tests__/label/remove.test.ts(the two/removehappy-path tests),eslint.config.mjs(one scoped rule). Nosrc/,dist/ordocs/change — disjoint from #510 (src/utils/auth.ts,dist/index.js) and #511 (docs/contributing.md).removes the specified label(line 25) andremoves multiple labels(line 47) registered mswDELETE …/issues/1/labels/<name>handlers, calledhandleIssueComment, and asserted nothing — the only two assertion-free tests among the 1656it/testbodies under__tests__/. Onmain@ 88241f4 the mutantremoveLabels(octokit, context, issueNumber, toRemove.slice(0, 1))insrc/labels/remove.tspasses all 6 tests in the file, and no bundle or errorPaths scenario drives a successful multi-label/remove(bundle.test.ts:814is the 500 arm;prefixedRemoveArms.test.ts:88-104anderrorPaths.test.ts:59-70are error arms).DELETEhandler now carries autils.ObserveRequestand the test awaits.called()for every requested label (two observers in the multi-label test);core.setFailedis asserted silent.eslint.config.mjsenables@vitest/eslint-plugin'stest/expect-expectfor__tests__/**/*.test.ts, withassertFunctionNames: ['expect', 'expect*', '*.called', '*.notCalled']so the suite's own helpers (expectRequests/expectWindowin__tests__/bundle,ObserveRequest.called()/notCalled()) count as assertions. Each whitelist entry is load-bearing: without*.calledthe rule also flagspullRequestOwners.test.ts:265, which asserts only viaobserveBranch.called().npm run lintalready runs inbuild-test, so the next assertion-free test is refused at lint time.Verification (this branch, local)
npx vitest run __tests__/label/remove.test.ts: 6 passedslice(0, 1)mutant applied tosrc/labels/remove.ts:removes multiple labelsfails (observed request was not called within 2000ms); mutant reverted, not committednpm run lint: 0 errors (the onejsdoc/check-param-nameswarning atsrc/issueComment/cc.ts:81is pre-existing onmain)mainwithout the test change, reports exactlyremove.test.ts:26and:48Related Issue
Refs #507 — the hive folded this finding into that tracker as a comment ("/remove happy-path tests (remove.test.ts:25,47) assert nothing"); this PR ticks both boxes of that comment. #507's own remaining boxes (
auth.ts:24, the BRDA note) belong to #510 and #511, so the tracker stays open.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88