chore: don't need escaped text now as it's actually a function call like all good javascripts

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-10-28 18:57:42 +02:00
parent 03f368f740
commit bb5fe02de3
+2 -3
View File
@@ -142,15 +142,14 @@ export async function waitForPageWithText(
waitUntil: 'networkidle0',
});
const escapedText = text.replace(/"|\\/g, '\\$&');
const match = await page.evaluate(() =>
Array.from(document.querySelectorAll('*')).some(
el => el.textContent === escapedText,
el => el.textContent === text,
),
);
if (!match) {
throw new Error(`Expected to find text ${escapedText}`);
throw new Error(`Expected to find text ${text}`);
}
break;