Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix client and env info normalization #588

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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