mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Return remote object description for unserializable objects
This patch starts handling unserializable objects by returning their description. Fixes #86.
This commit is contained in:
11
test/test.js
11
test/test.js
@@ -128,6 +128,10 @@ describe('Puppeteer', function() {
|
||||
let result = await page.evaluate(() => -Infinity);
|
||||
expect(Object.is(result, -Infinity)).toBe(true);
|
||||
}));
|
||||
it('should not fail for window object', SX(async function() {
|
||||
let result = await page.evaluate(() => window);
|
||||
expect(result).toBe('Window');
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Page.injectFile', function() {
|
||||
@@ -256,6 +260,13 @@ describe('Puppeteer', function() {
|
||||
'calling console.error',
|
||||
]);
|
||||
}));
|
||||
it('should not fail for window object', SX(async function() {
|
||||
let windowObj = null;
|
||||
page.once('console', arg => windowObj = arg);
|
||||
page.evaluate(() => console.error(window));
|
||||
await waitForEvents(page, 'console');
|
||||
expect(windowObj).toBe('Window');
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Page.navigate', function() {
|
||||
|
||||
Reference in New Issue
Block a user