test(page): make sure exposeFunction works with complex args (#4411)
This commit is contained in:
parent
5f66d82638
commit
b3027a6e16
@ -656,6 +656,13 @@ module.exports.addTests = function({testRunner, expect, headless, puppeteer, CHR
|
|||||||
});
|
});
|
||||||
expect(result).toBe(15);
|
expect(result).toBe(15);
|
||||||
});
|
});
|
||||||
|
it('should work with complex objects', async({page, server}) => {
|
||||||
|
await page.exposeFunction('complexObject', function(a, b) {
|
||||||
|
return {x: a.x + b.x};
|
||||||
|
});
|
||||||
|
const result = await page.evaluate(async() => complexObject({x: 5}, {x: 2}));
|
||||||
|
expect(result.x).toBe(7);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Page.Events.PageError', function() {
|
describe('Page.Events.PageError', function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user