Skip to content

Commit

Permalink
fix: 🐛 Config array merging (#391)
Browse files Browse the repository at this point in the history
* fix: 🐛 Overwrite default array options

* 🚨 tslint auto-fix
  • Loading branch information
Wil Wilsman committed Oct 4, 2019
1 parent 92fb452 commit 1574631
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .ci.percy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
version: 1
snapshot:
widths: [375, 1200]
percy-css: |
.percy-only-css-global {
height: 300px;
Expand Down
2 changes: 1 addition & 1 deletion src/services/image-snapshot-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ export default class ImageSnapshotService extends PercyClientService {
await this.buildService.finalize()

// if an error occurred, exit with non-zero
if (error) process.exit(1)
if (error) { process.exit(1) }
}
}
6 changes: 5 additions & 1 deletion src/utils/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,9 @@ export default function config({ config, ...flags }: any, args: any = {}) {
logger.debug(`Using config: ${inspect(overrides, { depth: null })}`)
}

return merge.all([DEFAULT_CONFIGURATION, overrides].filter(Boolean)) as Configuration
return merge.all(
[DEFAULT_CONFIGURATION, overrides].filter(Boolean),
// overwrite default arrays, do not merge
{ arrayMerge: (_, arr) => arr },
) as Configuration
}

0 comments on commit 1574631

Please sign in to comment.