Closed
Description
Context:
- GOOD Playwright Version: [what Playwright version worked nicely?] 1.8
- BAD Playwright Version: [what Playwright version doesn't work any more?] 1.17
- Operating System: [e.g. Windows, Linux or Mac] Ubuntu
- Extra: [any specific details about your environment]
Code Snippet
function add(...addends) {
return addends.reduce(
(accumulator, currentValue) => accumulator + currentValue
);
}
const functionResult = await page.evaluate(`
${add.toString()}
var result = add(1, 2, 3);
Promise.resolve(result);
`);
Describe the bug
I get the error:
page.evaluate: SyntaxError: Unexpected token 'var'
I am trying to migrate from an older jest-playwright-preset
setup to @playwright/test
, in the process updating playwright. This code worked before.
Metadata
Metadata
Assignees
Labels
No labels