diff --git a/packages/core/src/snapshot.js b/packages/core/src/snapshot.js index bbc7a225b..0f8e6a6b6 100644 --- a/packages/core/src/snapshot.js +++ b/packages/core/src/snapshot.js @@ -20,8 +20,8 @@ export function getSnapshotConfig(percy, options) { let log = logger('core:snapshot'); // migrate deprecated snapshot config options - let { clientInfo, environmentInfo, ...opts } = options; - let snapshot = PercyConfig.migrate(opts, '/snapshot'); + let { clientInfo, environmentInfo, ...snapshot } = ( + PercyConfig.migrate(options, '/snapshot')); // throw an error when missing required widths if (!(snapshot.widths ?? percy.config.snapshot.widths)?.length) { diff --git a/packages/core/test/snapshot.test.js b/packages/core/test/snapshot.test.js index df0af61e5..6a2a9b59e 100644 --- a/packages/core/test/snapshot.test.js +++ b/packages/core/test/snapshot.test.js @@ -209,13 +209,13 @@ describe('Snapshot', () => { await percy.snapshot({ name: 'test snapshot', url: 'http://localhost:8000', - clientInfo: 'test client info', - environmentInfo: 'test env info', + client_info: 'test client info', + environment_info: 'test env info', widths: [400, 1200], discovery: { - allowedHostnames: ['example.com'], - requestHeaders: { 'X-Foo': 'Bar' }, - disableCache: true + 'allowed-hostnames': ['example.com'], + 'request-headers': { 'X-Foo': 'Bar' }, + 'disable-cache': true }, additionalSnapshots: [ { prefix: 'foo ', waitForTimeout: 100 },