Skip to content

Commit fb0f6ed

Browse files
TheSpacyCatBenediktSeidl
authored andcommitted
allow explicit any in tests/
In testing, we often use mock objects that only provide the least necessary functionality to get the test running. Passing these objects to functions requires a lot of casting to the correct type in typescript, but allowing 'any' eases the problem.
1 parent d1d2738 commit fb0f6ed

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

tests/.eslintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": [
5+
"*.test.*"
6+
],
7+
"rules": {
8+
"@typescript-eslint/no-explicit-any": "off"
9+
}
10+
}
11+
]
12+
}

tests/unit/CloudEdition.test.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jest.mock('@grafana/runtime', () => {
2323
});
2424

2525
describe('Cloud Edition Restrictions', () => {
26-
// let's not put a bunch of properties in there we're not going to test for anyway
27-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2826
const options = { jsonData: {}, secureJsonData: {} } as any;
2927
const onOptionsChange = jest.fn();
3028

@@ -58,7 +56,6 @@ describe('Cloud Edition Restrictions', () => {
5856
getUrl() {
5957
return 'http://no.where/';
6058
},
61-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6259
} as any;
6360

6461
let subject: RestApiBackend;

0 commit comments

Comments
 (0)