test(lint): enable jest/no-standalone-expect ESLint rule - W-22865161#7417
Open
mshanemc wants to merge 8 commits into
Open
test(lint): enable jest/no-standalone-expect ESLint rule - W-22865161#7417mshanemc wants to merge 8 commits into
mshanemc wants to merge 8 commits into
Conversation
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Move standalone beforeEach expects out of test setup: - apexLspStatusBarItem.test.ts: drop no-op mock-defined assertions - variableAssignmentState.test.ts: keep state.handle() setup calls, drop standalone expect wrappers Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…le-jest-no-standalone-expect-eslint # Conflicts: # eslint.config.mjs
…22865161 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…le-jest-no-standalone-expect-eslint # Conflicts: # eslint.config.mjs
…ndalone-expect-eslint' into sm/W-22865161-enable-jest-no-standalone-expect-eslint
Contributor
Author
|
/ai-auto approve |
…le-jest-no-standalone-expect-eslint # Conflicts: # eslint.config.mjs
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
jest/no-standalone-expect: errorto jest rules block ineslint.config.mjsPlan
.claude/plans/W-22865161.md
Reviewer notes
expect(state.handle(context)).toBe(false)from 5 beforeEach hooks as lost coverage. Adversarial verification resolved this against that view: FrameEntryState.handle hardcodesreturn false(frameEntryState.ts:39), so the removed assertions only verified a constant return value, not VariableAssignmentState behavior. The barestate.handle(context)setup still exercises the side effects asserted by the actual it() blocks. No meaningful coverage lost; the jest/no-standalone-expect fix is correct as applied. No code change made.expect(...).toBeDefined()checks on mocks assigned via jest.spyOn in beforeEach. jest.spyOn always returns a SpyInstance (never undefined), so these were tautologies testing Jest's API, not setup. Mocks remain exercised by behavior tests. Correct removal under newly enabled jest/no-standalone-expect. No code change made.Test plan
npm run lintpasses (stop hook covers)What issues does this PR fix or reference?
@W-22865161@
🤖 Generated by auto-build pipeline. Original WI: https://gus.my.salesforce.com/a07EE00002bbsgFYAQ