diff --git a/test/test.js b/test/test.js index 1febcc41..47f60eae 100644 --- a/test/test.js +++ b/test/test.js @@ -389,6 +389,9 @@ describe('Page', function() { const result = await page.evaluate((a, b) => Object.is(a, undefined) && Object.is(b, 'foo'), undefined, 'foo'); expect(result).toBe(true); }); + it('should properly serialize null fields', async({page}) => { + expect(await page.evaluate(() => ({a: undefined}))).toEqual({}); + }); it('should fail for window object', async({page, server}) => { const result = await page.evaluate(() => window); expect(result).toBe(undefined);