Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ overrides:
- files:
- test/fixtures/**
rules:
jest/require-hook: off
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is not disabled for the fixture files, they all generate a message about this rule, like the fixture has to be in a hook, which is not true, so to me it looks like it should be disabled for these files. not sure though if additional configuration for this rule is needed for it to work correctly in other repos

unicorn/filename-case: off
- files:
- test/**.spec.ts
Expand Down
207 changes: 195 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^3.7.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"eslint-plugin-unicorn": "^39.0.0",
Expand Down
1 change: 0 additions & 1 deletion rules/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
'jest/no-conditional-expect': 'off',
'jest/require-top-level-describe': 'off',
'jest/prefer-called-with': 'off',
'jest/prefer-inline-snapshots': 'off',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'jest/prefer-expect-assertions': 'error',
'jest/unbound-method': ['error', { ignoreStatic: true }],
'jest/valid-title': ['error', { disallowedWords: ['should'] }],
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/jest/prefer-expect-assertions.fail.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
it('my second test', (): void => {
expect(1).toStrictEqual('foo');
expect(1).toBe('foo');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

});
4 changes: 2 additions & 2 deletions test/fixtures/jest/prefer-expect-assertions.pass.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
it('my test', (): void => {
expect.assertions(1);
expect(1).toStrictEqual('foo');
expect(1).toBe('foo');
});

it('my test 2', (): void => {
expect.hasAssertions();
expect(1).toStrictEqual('foo');
expect(1).toBe('foo');
});