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 of issue id #1674, reporting false positive invalid config warning. #1675

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
2 changes: 1 addition & 1 deletion packages/config/src/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function load({
config = normalize(config, { overrides, schema: '/config' });
let errors = config && validate(config);

if (errors) {
if (errors?.length > 0) {
log.warn('Invalid config:');
for (let e of errors) log.warn(`- ${e.path}: ${e.message}`);
if (bail) return;
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/percy.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class Percy {
// validate provided config options
let errors = PercyConfig.validate(config);

if (errors) {
if (errors?.length > 0) {
this.log.warn('Invalid config:');
for (let e of errors) this.log.warn(`- ${e.path}: ${e.message}`);
}
Expand Down Expand Up @@ -386,7 +386,7 @@ export class Percy {
let { clientInfo, environmentInfo, ...comparison } = options;
let errors = PercyConfig.validate(comparison, '/comparison');

if (errors) {
if (errors?.length > 0) {
this.log.warn('Invalid upload options:');
for (let e of errors) this.log.warn(`- ${e.path}: ${e.message}`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function validateSnapshotOptions(options) {
// warn on validation errors
let errors = PercyConfig.validate(migrated, schema);

if (errors) {
if (errors?.length > 0) {
log.warn('Invalid snapshot options:');
for (let e of errors) log.warn(`- ${e.path}: ${e.message}`);
}
Expand Down
Loading