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"],
|
"parameters": ["webDriverBiDi"],
|
||||||
"expectations": ["PASS"]
|
"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",
|
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should replace symbols with undefined",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -515,6 +509,12 @@
|
|||||||
"parameters": ["cdp"],
|
"parameters": ["cdp"],
|
||||||
"expectations": ["FAIL"]
|
"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 *",
|
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluateOnNewDocument *",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
@ -324,16 +324,29 @@ describe('Evaluation specs', function () {
|
|||||||
promise: {},
|
promise: {},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('should fail for circular object', async () => {
|
it('should work for circular object', async () => {
|
||||||
const {page} = await getTestState();
|
const {page} = await getTestState();
|
||||||
|
|
||||||
const result = await page.evaluate(() => {
|
const result = await page.evaluate(() => {
|
||||||
const a: Record<string, unknown> = {};
|
const a: Record<string, unknown> = {
|
||||||
|
c: 5,
|
||||||
|
d: {
|
||||||
|
foo: 'bar',
|
||||||
|
},
|
||||||
|
};
|
||||||
const b = {a};
|
const b = {a};
|
||||||
a['b'] = b;
|
a['b'] = b;
|
||||||
return a;
|
return a;
|
||||||
});
|
});
|
||||||
expect(result).toBe(undefined);
|
expect(result).toMatchObject({
|
||||||
|
c: 5,
|
||||||
|
d: {
|
||||||
|
foo: 'bar',
|
||||||
|
},
|
||||||
|
b: {
|
||||||
|
a: undefined,
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
it('should accept a string', async () => {
|
it('should accept a string', async () => {
|
||||||
const {page} = await getTestState();
|
const {page} = await getTestState();
|
||||||
|
Loading…
Reference in New Issue
Block a user