Skip to content

Commit

Permalink
[test] Add explicit types to support noImplicityAny=false (mui#30798)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw authored and wladimirguerra committed Feb 2, 2022
1 parent 29f02a0 commit 37e293e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/utils/initMatchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ chai.use((chaiAPI, utils) => {
? [expectedMessagesInput]
: expectedMessagesInput.slice();
const unexpectedMessages: Error[] = [];
let caughtError = null;
// TODO Remove type once MUI X enables noImplicitAny
let caughtError: unknown | null = null;

this.assert(
expectedMessages.length > 0,
Expand Down Expand Up @@ -551,7 +552,8 @@ chai.use((chaiAPI, utils) => {
const expectedMessage = remainingMessages.shift();
messagesMatched += 1;

let message = null;
// TODO Remove type once MUI X enables noImplicitAny
let message: string | null = null;
if (expectedMessage === undefined) {
message = `Expected no more error messages but got:\n"${actualMessage}"`;
} else if (!actualMessage.includes(expectedMessage)) {
Expand Down

0 comments on commit 37e293e

Please sign in to comment.