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 docs for override -> options #1322

Merged
merged 1 commit into from
Jul 19, 2023
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
16 changes: 8 additions & 8 deletions packages/cli-snapshot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static:
include: **/*.html
exclude: []
rewrites: {}
overrides: []
options: []
```

- **base-url** - The base URL path the static site should be served under.
Expand Down Expand Up @@ -256,18 +256,18 @@ static:
/:year: /posts/index-:year.html
```

- **overrides** - An array of per-snapshot option overrides.
- **options** - An array of per-snapshot options.

Just like [page listing options](#page-options), static snapshots may also contain
per-snapshot configuration options. However, since pages are matched against the `files`
option, so are per-snapshot configuration options via an array of `overrides`. If multiple
overrides match a snapshot, they will be merged with previously matched overrides.
option, so are per-snapshot configuration options via an array of `options`. If multiple
options match a snapshot, they will be merged with previously matched options.

``` yaml
# .percy.yml
version: 2
static:
overrides:
options:
- files: /foo-bar.html
waitForSelector: .is-ready
execute: |
Expand All @@ -277,7 +277,7 @@ static:
### Sitemap URL

When providing a sitemap URL, the document must be an XML document. For sitemap URLs the `--include` and
`--exclude` flags can be used to filter snapshots. With a Percy config file, the `overrides` option
`--exclude` flags can be used to filter snapshots. With a Percy config file, the `options` option
is also accepted.

> Tip: Sitemaps can contain **a lot** of URLs, so its best to always start with the `--dry-run` flag
Expand Down Expand Up @@ -308,8 +308,8 @@ version: 2
static:
include: **/*.html
exclude: []
overrides: []
options: []
```

See [the corresponding static options](#static-options) for details on `includes`, `excludes`, and
`overrides` options.
`options` options.
2 changes: 1 addition & 1 deletion packages/cli-snapshot/test/sitemap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('percy snapshot <sitemap>', () => {
]);
});

it('accepts snapshot config overrides', async () => {
it('accepts snapshot config options', async () => {
fs.writeFileSync('.percy.yml', [
'version: 2',
'sitemap:',
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 @@ -79,7 +79,7 @@ function mapSnapshotOptions(snapshots, context) {
snapshotMatches(snap, include, exclude) ? Object.assign(snap, opts) : snap
), snap => getSnapshotOptions(snap, context));

// reduce snapshots with overrides
// reduce snapshots with options
return snapshots.reduce((acc, snapshot) => {
// transform snapshot URL shorthand into an object
if (typeof snapshot === 'string') snapshot = { url: snapshot };
Expand Down