Skip to content

fix: use spyOn for controller method assertions in specs - #714

Open
DeFex-lab wants to merge 1 commit into
MergeFi:mainfrom
DeFex-lab:fix/issue-606-controller-specs-pass-unbound-methods-to-expect
Open

DeFex-lab wants to merge 1 commit into
MergeFi:mainfrom
DeFex-lab:fix/issue-606-controller-specs-pass-unbound-methods-to-expect

Conversation

@DeFex-lab

Copy link
Copy Markdown

Overview

This PR fixes @typescript-eslint/unbound-method lint errors in the GitHub controller specs, where unbound method references were passed to expect(). The offending assertions are replaced with jest.spyOn-based references so npm run lint can pass while keeping the rule enabled.

Related Issue

Changes

🧪 Controller Spec Fixes

  • [MODIFY] src/github/github.controller.spec.ts

    • Replaces the unbound expect(controller.sync)-style references at lines 62 and 71 with jest.spyOn-based assertions, so the method is referenced through a bound spy rather than an unbound prototype method.
  • [MODIFY] src/github/github-webhooks.controller.spec.ts

    • Replaces the unbound method reference at line 142 with a jest.spyOn-based assertion, consistent with the fix in the other spec.

Verification Results

npm run lint
✅ unbound-method errors at github.controller.spec.ts:62, :71 and github-webhooks.controller.spec.ts:142 resolved
Acceptance Criteria Status
unbound-method errors at github.controller.spec.ts:62 and :71 are resolved ✅ Assertions now use jest.spyOn
unbound-method error at github-webhooks.controller.spec.ts:142 is resolved ✅ Assertion now uses jest.spyOn
The @typescript-eslint/unbound-method rule is kept enabled ✅ No ESLint config changes

Closes #606

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@DeFex-lab is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@DeFex-lab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

This branch has not been deployed

No deployments
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.

Controller specs pass unbound methods to expect() (unbound-method lint errors)

1 participant