-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab65a7f
commit c143a45
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/node_modules/expect-puppeteer/dist/index.js b/node_modules/expect-puppeteer/dist/index.js | ||
index 9db58ab..e1718b8 100644 | ||
--- a/node_modules/expect-puppeteer/dist/index.js | ||
+++ b/node_modules/expect-puppeteer/dist/index.js | ||
@@ -4,13 +4,13 @@ const checkIsPuppeteerInstance = (instance)=>{ | ||
return Boolean(instance?.constructor?.name && typeof instance === "object" && "$" in instance); | ||
}; | ||
const checkIsPage = (instance)=>{ | ||
- return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "CDPPage"; | ||
+ return checkIsPuppeteerInstance(instance) && (instance?.constructor?.name === "CDPPage" || instance?.constructor?.name === "CdpPage"); | ||
}; | ||
const checkIsFrame = (instance)=>{ | ||
return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "Frame"; | ||
}; | ||
const checkIsElementHandle = (instance)=>{ | ||
- return checkIsPuppeteerInstance(instance) && instance?.constructor?.name === "CDPElementHandle"; | ||
+ return checkIsPuppeteerInstance(instance) && (instance?.constructor?.name === "CDPElementHandle" || instance?.constructor?.name === "CdpElementHandle"); | ||
}; | ||
const getContext = async (instance, pageFunction)=>{ | ||
if (checkIsFrame(instance) || checkIsPage(instance)) { | ||
@@ -485,6 +485,7 @@ const expectPuppeteerInstance = (actual)=>{ | ||
if (checkIsElementHandle(actual)) { | ||
return createExpect(actual, elementHandleMatchers); | ||
} | ||
+ console.log(actual, actual?.constructor?.name); | ||
throw new Error(`${actual} is not supported`); | ||
}; | ||
const expectPuppeteer = (actual)=>{ |