1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-31 13:44:28 +03:00

Fix jest/no-conditional-expect lint and enable it (#10307)

This commit is contained in:
Michael Telatynski
2023-03-07 13:58:10 +00:00
committed by GitHub
parent 2c97cb4054
commit af1ec76149
8 changed files with 49 additions and 83 deletions

View File

@ -56,8 +56,10 @@ describe("FixedRollingArray", () => {
expect(previous - current).toBe(1);
if (i === 1) {
// eslint-disable-next-line jest/no-conditional-expect
expect(previous).toBe(maxValue);
} else if (i === width) {
// eslint-disable-next-line jest/no-conditional-expect
expect(current).toBe(minValue);
}
}

View File

@ -28,13 +28,7 @@ describe("Singleflight", () => {
[null, "test"],
];
for (const p of permutations) {
try {
Singleflight.for(p[0], p[1]);
// noinspection ExceptionCaughtLocallyJS
throw new Error("failed to fail: " + JSON.stringify(p));
} catch (e) {
expect(e.message).toBe("An instance and key must be supplied");
}
expect(() => Singleflight.for(p[0], p[1])).toThrow("An instance and key must be supplied");
}
});