mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: flip test (#11707)
This commit is contained in:
parent
76da4e6479
commit
280249ff2f
@ -497,12 +497,6 @@
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["PASS"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should fail for circular object",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should replace symbols with undefined",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
@ -515,6 +509,12 @@
|
||||
"parameters": ["cdp"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should work for circular object",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["cdp"],
|
||||
"expectations": ["FAIL"]
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluateOnNewDocument *",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
@ -324,16 +324,29 @@ describe('Evaluation specs', function () {
|
||||
promise: {},
|
||||
});
|
||||
});
|
||||
it('should fail for circular object', async () => {
|
||||
it('should work for circular object', async () => {
|
||||
const {page} = await getTestState();
|
||||
|
||||
const result = await page.evaluate(() => {
|
||||
const a: Record<string, unknown> = {};
|
||||
const a: Record<string, unknown> = {
|
||||
c: 5,
|
||||
d: {
|
||||
foo: 'bar',
|
||||
},
|
||||
};
|
||||
const b = {a};
|
||||
a['b'] = b;
|
||||
return a;
|
||||
});
|
||||
expect(result).toBe(undefined);
|
||||
expect(result).toMatchObject({
|
||||
c: 5,
|
||||
d: {
|
||||
foo: 'bar',
|
||||
},
|
||||
b: {
|
||||
a: undefined,
|
||||
},
|
||||
});
|
||||
});
|
||||
it('should accept a string', async () => {
|
||||
const {page} = await getTestState();
|
||||
|
Loading…
Reference in New Issue
Block a user