chore: assert location value of ConsoleMessage in tests (#6282)

This commit is contained in:
Christian Bromann 2020-07-29 13:13:50 +02:00 committed by GitHub
parent 713e990531
commit 9bc063b5ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -461,6 +461,13 @@ describe('Page', function () {
]);
expect(message.text()).toEqual('hello 5 JSHandle@object');
expect(message.type()).toEqual('log');
expect(message.args()).toHaveLength(3);
expect(message.location()).toEqual({
url: expect.any(String),
lineNumber: expect.any(Number),
columnNumber: expect.any(Number),
});
expect(await message.args()[0].jsonValue()).toEqual('hello');
expect(await message.args()[1].jsonValue()).toEqual(5);
expect(await message.args()[2].jsonValue()).toEqual({ foo: 'bar' });