Skip to content

Commit 070a257

Browse files
authored
test: move all generic page tests to jest (#3002)
1 parent 5cf3e4f commit 070a257

26 files changed

+146
-141
lines changed

src/webkit/wkExecutionContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ const contextDestroyedResult = {
147147

148148
function potentiallyUnserializableValue(remoteObject: Protocol.Runtime.RemoteObject): any {
149149
const value = remoteObject.value;
150-
const unserializableValue = remoteObject.type === 'number' && value === null ? remoteObject.description : undefined;
151-
return unserializableValue ? js.parseUnserializableValue(unserializableValue) : value;
150+
const isUnserializable = remoteObject.type === 'number' && ['NaN', '-Infinity', 'Infinity', '-0'].includes(remoteObject.description!);
151+
return isUnserializable ? js.parseUnserializableValue(remoteObject.description!) : value;
152152
}
153153

154154
function rewriteError(error: Error): Error {

test/capabilities.spec.js renamed to test/capabilities.jest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
const {FFOX, CHROMIUM, WEBKIT, WIN, LINUX} = require('./utils').testOptions(browserType);
17+
const {FFOX, CHROMIUM, WEBKIT, WIN, LINUX} = testOptions;
1818

1919
describe('Capabilities', function() {
2020
it.fail(WEBKIT && WIN)('Web Assembly should work', async function({page, server}) {

test/emulation.jest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,8 @@ describe('focus', function() {
584584
page.screenshot(),
585585
page2.screenshot(),
586586
]);
587-
expect(screenshots[0]).toMatchImageSnapshot('screenshot-sanity');
588-
expect(screenshots[1]).toMatchImageSnapshot('grid-cell-0');
587+
expect(screenshots[0]).toBeGolden('screenshot-sanity.png');
588+
expect(screenshots[1]).toBeGolden('grid-cell-0.png');
589589
});
590590
it('should change focused iframe', async({page, server}) => {
591591
await page.goto(server.EMPTY_PAGE);

test/geolocation.spec.js renamed to test/geolocation.jest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
const {FFOX, CHROMIUM, WEBKIT} = require('./utils').testOptions(browserType);
18+
const {FFOX, CHROMIUM, WEBKIT} = testOptions;
1919

2020
describe('Overrides.setGeolocation', function() {
2121
it('should work', async({page, server, context}) => {
-436 Bytes
Binary file not shown.
-35.4 KB
Binary file not shown.
-331 Bytes
Binary file not shown.
-35.4 KB
Binary file not shown.
-478 Bytes
Binary file not shown.
-35.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)