From f0b11ad22ee0a3f98436f816de88a20c631d7c75 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 4 Jan 2018 11:30:29 -0800 Subject: [PATCH] test: verify serialization of "undefined" fields (#1721) Fixes #1510. --- test/test.js | 3 +++ 1 file changed, 3 insertions(+) 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);