diff --git a/test/lib/next-test-utils.ts b/test/lib/next-test-utils.ts index 22ce39ae0b1c0..dfb6477df6b12 100644 --- a/test/lib/next-test-utils.ts +++ b/test/lib/next-test-utils.ts @@ -617,7 +617,7 @@ export async function check( for (let tries = 0; tries < maxRetries; tries++) { try { content = await contentFn() - if (!(regex instanceof RegExp)) { + if (typeof regex !== typeof /regex/) { if (regex === content) { return true }