Skip to content

Commit

Permalink
test(page): make sure exposeFunction works with complex args (#4411)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed May 10, 2019
1 parent 5f66d82 commit b3027a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/page.spec.js
Expand Up @@ -656,6 +656,13 @@ module.exports.addTests = function({testRunner, expect, headless, puppeteer, CHR
});
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() {
Expand Down

0 comments on commit b3027a6

Please sign in to comment.