Skip to content

Commit 91de37e

Browse files
committed
migrate jest and jest-extended conf in tests
1 parent bb3cad3 commit 91de37e

File tree

2 files changed

+47
-36
lines changed

2 files changed

+47
-36
lines changed

test/.eslintrc.cjs

Lines changed: 0 additions & 36 deletions
This file was deleted.

test/eslint.config.mjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
Copyright 2021 Bonitasoft S.A.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
const pluginJest = require('eslint-plugin-jest');
18+
const pluginJestExtended = require('eslint-plugin-jest-extended');
19+
20+
module.exports = [
21+
{
22+
files: ['**/*.test.ts'],
23+
plugins: { jest: pluginJest, 'jest-extended': pluginJestExtended },
24+
...jest.configs['flat/recommended'],
25+
...jest.configs['flat/style'],
26+
...'jest-extended'.configs['flat/recommended'],
27+
languageOptions: {
28+
globals: pluginJest.environments.globals.globals,
29+
},
30+
settings: {
31+
jest: {
32+
version: require('jest/package.json').version,
33+
},
34+
},
35+
rules: {
36+
...jest.configs['flat/recommended'].rules,
37+
...jest.configs['flat/style'].rules,
38+
...'jest-extended'.configs['flat/recommended'].rules,
39+
/* The rule list: https://github.com/jest-community/eslint-plugin-jest#rules */
40+
'jest/prefer-expect-resolves': 'warn',
41+
'jest/prefer-spy-on': 'warn',
42+
'jest/prefer-todo': 'warn',
43+
/* The rule didn't find the 'expect' in the called methods */
44+
'jest/expect-expect': 'off',
45+
},
46+
},
47+
];

0 commit comments

Comments
 (0)