-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(new rules): Implement to have been called with (#325)
* feat(added docs for the new rule): new rules docs done * chore(formating): apply linter
- Loading branch information
Showing
61 changed files
with
5,295 additions
and
5,180 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` (`vitest/prefer-called-exactly-once-with`) | ||
|
||
⚠️ This rule _warns_ in the 🌐 `all` config. | ||
|
||
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). | ||
|
||
<!-- end auto-generated rule header --> | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
test('foo', () => { | ||
const mock = jest.fn() | ||
mock('foo') | ||
expect(mock).toHaveBeenCalledOnce() | ||
expect(mock).toHaveBeenCalledWith() | ||
}) | ||
``` | ||
|
||
```js | ||
test('foo', () => { | ||
const mock = jest.fn() | ||
mock('foo') | ||
expect(mock).toHaveBeenCalledExactlyOnceWith('foo') | ||
}) | ||
``` |
This file contains 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
Oops, something went wrong.