fix: properly expose top-level devices (#698)

This commit is contained in:
Andrey Lushnikov 2020-01-27 17:21:39 -08:00 committed by GitHub
parent e9515f46d2
commit 54f442e0f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,7 @@
const { helper } = require('./lib/helper');
const api = require('./lib/api');
const packageJson = require('./package.json');
const DeviceDescriptors = require('./lib/deviceDescriptors');
const { DeviceDescriptors } = require('./lib/deviceDescriptors');
const { TimeoutError } = require('./lib/errors');
const { Chromium } = require('./lib/server/chromium');
const { Firefox } = require('./lib/server/firefox');

View File

@ -138,7 +138,9 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p
});
it('should require top-level DeviceDescriptors', async() => {
const Devices = require(path.join(utils.projectRoot(), '/lib/deviceDescriptors.js')).DeviceDescriptors;
expect(Devices['iPhone 6']).toBeTruthy();
expect(Devices['iPhone 6']).toBe(playwright.devices['iPhone 6']);
expect(Devices['iPhone 6']).toBe(require(playwrightPath).devices['iPhone 6']);
});
});