Skip to content

linter: jest/prefer-ending-with-an-expect false positive with vi.mock #21413

Description

@cexbrayat

What version of Oxlint are you using?

1.60.0

What command did you run?

oxlint -c .oxlintrc.json

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

{                                                                                                                     
  "plugins": ["jest"],                                       
  "rules": {                                                                                                          
    "jest/prefer-ending-with-an-expect": "error"                                                                      
  }
}

What happened?

The command throws an error for vi.mock calls

2 |
      3 | vi.mock(import('foo'), () => vi.fn());
        : ^^^^^^^
        `----
       help: Add an `expect` or assertion call as the last statement in the test block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions