-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Reduce quickPluginTest
and quickVariantPluginTest
snapshot size
#12170
Merged
Conversation
This file contains 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
By default we use the default config when creating the quick tests for a given plugin. However, this can result in _a lot_ of changes. For example, when you update the opacity values, then these values will be generated for each color, and for each plugin that uses that color. You can see that behaviour in Adam's PR (#11832). He added 6 values to the opacity configuration. This resulted in a diff that looked like this: ``` +219,436 −9 ``` This reduces the amount of examples for plugins that generate _a lot_ of output otherwise.
This way all the `quickPluginTest` and `quickVariantPluginTest` implementations are the same. This also allows us to update tests after config changes in an easier way because they use snapshot tests right now.
This will make it a tiny bit easier to debug what's going on if we need it in the future since it's using the same values as the real colors.
RobinMalfait
changed the title
Reduce quick test snapshot size
Reduce Oct 9, 2023
quickPluginTest
and quickVariantPluginTest
snapshot size
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to nix6839/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Oct 9, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Nov 2, 2023
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Nov 2, 2023
RobinMalfait
added a commit
that referenced
this pull request
Nov 2, 2023
* Add forced-colors-adjust utilities * Update forcedColorsAdjust.test.js * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * rename `forced-colors-adjust` -> `forced-color-adjust` Dropped the `s` in `colors`. * update changelog * fix typo * use full `forced-color-adjust-auto` and `forced-color-adjust-none` names --------- Co-authored-by: Robin Malfait <[email protected]>
RobinMalfait
added a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Nov 2, 2023
RobinMalfait
added a commit
that referenced
this pull request
Nov 2, 2023
* Add forced-colors variant Also add a contrast-custom variant to match custom contrast preferences * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * remove `contrast-custom` variant * move `forcedColorsVariants` next to `prefersContrastVariants` * update changelog --------- Co-authored-by: Robin Malfait <[email protected]>
lukewarlow
pushed a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Nov 7, 2023
lukewarlow
pushed a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Nov 7, 2023
lukewarlow
pushed a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Nov 7, 2023
lukewarlow
pushed a commit
to lukewarlow/tailwindcss
that referenced
this pull request
Nov 7, 2023
thecrypticace
pushed a commit
that referenced
this pull request
Dec 4, 2023
* Add forced-colors-adjust utilities * Update forcedColorsAdjust.test.js * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * rename `forced-colors-adjust` -> `forced-color-adjust` Dropped the `s` in `colors`. * update changelog * fix typo * use full `forced-color-adjust-auto` and `forced-color-adjust-none` names --------- Co-authored-by: Robin Malfait <[email protected]>
thecrypticace
pushed a commit
that referenced
this pull request
Dec 4, 2023
* Add forced-colors variant Also add a contrast-custom variant to match custom contrast preferences * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * remove `contrast-custom` variant * move `forcedColorsVariants` next to `prefersContrastVariants` * update changelog --------- Co-authored-by: Robin Malfait <[email protected]>
thecrypticace
pushed a commit
that referenced
this pull request
Dec 5, 2023
* Add forced-colors-adjust utilities * Update forcedColorsAdjust.test.js * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * rename `forced-colors-adjust` -> `forced-color-adjust` Dropped the `s` in `colors`. * update changelog * fix typo * use full `forced-color-adjust-auto` and `forced-color-adjust-none` names --------- Co-authored-by: Robin Malfait <[email protected]>
thecrypticace
pushed a commit
that referenced
this pull request
Dec 5, 2023
* Add forced-colors variant Also add a contrast-custom variant to match custom contrast preferences * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * remove `contrast-custom` variant * move `forcedColorsVariants` next to `prefersContrastVariants` * update changelog --------- Co-authored-by: Robin Malfait <[email protected]>
thecrypticace
pushed a commit
that referenced
this pull request
Dec 18, 2023
* Add forced-colors-adjust utilities * Update forcedColorsAdjust.test.js * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * rename `forced-colors-adjust` -> `forced-color-adjust` Dropped the `s` in `colors`. * update changelog * fix typo * use full `forced-color-adjust-auto` and `forced-color-adjust-none` names --------- Co-authored-by: Robin Malfait <[email protected]>
thecrypticace
pushed a commit
that referenced
this pull request
Dec 18, 2023
* Add forced-colors variant Also add a contrast-custom variant to match custom contrast preferences * use `toMatchSnapshot` instead of `toMatchFormattedCss` More info: #12170 * remove `contrast-custom` variant * move `forcedColorsVariants` next to `prefersContrastVariants` * update changelog --------- Co-authored-by: Robin Malfait <[email protected]>
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.
This PR reduces the output of the quick test helpers.
The quick test helpers generate all the possible combinations based on the default config for a given plugin. However, this can result in very large diffs if a relatively simple change is made to the default config.
For example, this can be observed in Adam's PR (#11832) where adding 6 opacity values resulted in 200k lines added. This happened because we have a dozen plugins that use the opacity values for each color in the configuration.
This PR will still use the default configuration as much as possible, but for certain tests this is reduced to a much simpler set of color values to prevent the state explosion.
We technically don't test the default values for those colors anymore in the quick tests, but it still tests a few scenario's.
This PR also updates all the
quickPluginTest
andquickVariantPluginTest
helpers to usetoMatchSnapshot()
. While this introduced many snapshot files, it will and should also make it easier in the future to update them in case we add a new value to the default config.