✨ Add static snapshot clean-urls and rewrites options#447
Merged
Conversation
samarsault
pushed a commit
that referenced
this pull request
Mar 3, 2023
* ⬆️ Bump cypress from 9.1.1 to 9.2.0 Bumps [cypress](https://github.com/cypress-io/cypress) from 9.1.1 to 9.2.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](cypress-io/cypress@v9.1.1...v9.2.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * 💚 Fix setting `isInteractive` in test suite Cypress 9.2 released an update that disallows setting config options at run time (as they're supposed to be readonly). This breaks out test suite, so to get around that I just manually set the value (rather than using their setter). Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Robert DeLuca <robertdeluca19@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this?
This adds two new options for static snapshots and refactors small parts of the snapshot command.
Logic that differed between static and non-static usages were moved into their respective implementation specific methods. This includes
base-urlerror handling and default/normalized page options. Although the latter is shared, how the server address and non-staticbase-urlis determined is specific to each implementation. Tests were also refactored a bit so suite hooks run for each test, and a couple other small test changes were made as well.The
clean-urlsoption is passed along to the static server handler directly, while therewritesoption is concatenated to anybase-urlrewrite. Therewritesare then also used in conjunction withoverridesto generate a default page URL from the static file path. Another rewrite override is used to remove indexes and extensions from page URLs whenclean-urlsis true.For config files, we don't want to normalize nested keys within
rewrites, so it was added to the ignore-list in@percy/config's normalize module (with tests).The snapshot command readme was also updated.
Resolves #420