Skip to content

Commit 5db567e

Browse files
Enable strict mode in tsconfig and fix type errors (#11200)
Co-authored-by: Lenz Weber-Tronic <[email protected]>
1 parent c87bf54 commit 5db567e

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/testing/internal/profile/profile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export function profile<
203203
return render;
204204
},
205205
async takeRender(options: NextRenderOptions = {}) {
206-
let error: { message?: string } | undefined = undefined;
206+
let error: unknown = undefined;
207207
try {
208208
return await Profiled.peekRender({
209209
[_stackTrace]: captureStackTrace(Profiled.takeRender),

src/testing/matchers/ProfiledComponent.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import type {
66
ProfiledHook,
77
} from "../internal/index.js";
88
export const toRerender: MatcherFunction<[options?: NextRenderOptions]> =
9-
async function (
10-
_profiled: ProfiledComponent<any, any> | ProfiledHook<any, any>,
11-
options?: NextRenderOptions
12-
) {
9+
async function (actual, options) {
10+
const _profiled = actual as
11+
| ProfiledComponent<any, any>
12+
| ProfiledHook<any, any>;
1313
const profiled =
1414
"ProfiledComponent" in _profiled
1515
? _profiled.ProfiledComponent
@@ -42,11 +42,10 @@ const failed = {};
4242

4343
export const toRenderExactlyTimes: MatcherFunction<
4444
[times: number, options?: NextRenderOptions]
45-
> = async function (
46-
_profiled: ProfiledComponent<any, any> | ProfiledHook<any, any>,
47-
times: number,
48-
optionsPerRender?: NextRenderOptions
49-
) {
45+
> = async function (actual, times, optionsPerRender) {
46+
const _profiled = actual as
47+
| ProfiledComponent<any, any>
48+
| ProfiledHook<any, any>;
5049
const profiled =
5150
"ProfiledComponent" in _profiled ? _profiled.ProfiledComponent : _profiled;
5251
const options = { timeout: 100, ...optionsPerRender };

0 commit comments

Comments
 (0)