-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: cov_1hphpf4qcw is not defined #5175
Comments
Can you point us to the evaluate call that is failing? |
when I run my function everything work properly. My result is correct. but If I try to test my function I have the issue |
Your code coverage tool is injecting code console.log node_modules/puppeteer/lib/ExecutionContext.js:108
() => {
/* istanbul ignore next */
cov_npcpcae6x.f[2]++;
cov_npcpcae6x.s[19]++;
window.scrollTo(0, document.getElementsByTagName('ytd-app')[0].getBoundingClientRect().height);
}
//# sourceURL=__puppeteer_evaluation_script__ That code is being sent and executed in Chromium. On the browser side, |
thank you for your help! |
@frantallukas10 They talk about that here jestjs/jest#7962 and here jestjs/jest#6793 As a workaround, you can also send the function as a string, so no one gets in the middle. |
|
maybe it will be better add this information for this error... @kblok |
@kblok could you elaborate on sending the function as a string, maybe with an example? |
@pgoos the jest team added an explanation in their docs :) https://jestjs.io/docs/puppeteer |
Thanks for the response @kblok /* istanbul ignore next */
const { headerHTML, footerHTML } = await page.evaluate(() => {
....
} |
I have problem create test for my function
here is my project https://github.com/frantallukas10/youtu-get
I try to create test for my function where I use puppeteer for get every title and id from youtube playlist
here is my test: https://github.com/frantallukas10/youtu-get/blob/master/tests/test.js
and here is my function: https://github.com/frantallukas10/youtu-get/blob/master/src/main.js
thank you for your help or information... =)
The text was updated successfully, but these errors were encountered: