Skip to content

Commit

Permalink
🐛 Fix client and env info normalization (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wil Wilsman authored Oct 19, 2021
1 parent b213554 commit ee04cc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions packages/core/test/snapshot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit ee04cc7

Please sign in to comment.