|
4 | 4 |
|
5 | 5 | ### Patch Changes |
6 | 6 |
|
7 | | -- c7b0e4e: **Bug Fixes** |
8 | | - |
9 | | - - Fix native `toHaveStyleRule` crash when element has no `style` prop (#225, #110) |
10 | | - - Fix nested at-rules (`@media` inside `@supports` and vice versa) not being found by `toHaveStyleRule` (#245) |
11 | | - - Fix `getHTML()` creating an empty `ServerStyleSheet` instead of reading from the global sheet (#401) |
12 | | - - Fix selector matching with spaces around CSS combinators (`> ul > li > a` now matches correctly) |
13 | | - - Fix invalid CSS causing cryptic parse errors — now shows the offending rule with surrounding context and a caret pointing at the exact error position (#147) |
14 | | - |
15 | | - **Improvements** |
16 | | - |
17 | | - - Add opt-in CSS parse caching via `import 'jest-styled-components/cache'` for faster `toHaveStyleRule` in large test suites (#235) |
18 | | - - Normalize whitespace in value comparisons so `red !important`, `sidebar / inline-size`, and `rgb(0, 0, 0)` match their stylis-formatted equivalents (skips quoted strings) |
19 | | - - Clearer validation messages: "Property not found" instead of cryptic crash, human-readable options formatting, better negation wording |
20 | | - - Add `cache/index.d.ts` for TypeScript users importing the cache entry point |
21 | | - - Use `Set` for hash lookups (O(1) vs O(n) per lookup) |
22 | | - - Serializer no longer mutates the parsed CSS AST |
| 7 | +- Fix native `toHaveStyleRule` crash when element has no `style` prop (#225, #110) |
| 8 | +- Fix nested at-rules (`@media` inside `@supports` and vice versa) not found by `toHaveStyleRule` (#245) |
| 9 | +- Fix `getHTML()` creating an empty `ServerStyleSheet` instead of reading from the global sheet (#401) |
| 10 | +- Fix selector matching with spaces around CSS combinators (`> ul > li > a`) |
| 11 | +- Fix invalid CSS causing cryptic parse errors — shows the offending rule with context and caret (#147) |
| 12 | +- Fix nested React Native style arrays not flattening correctly |
| 13 | +- Add `@container` and `@layer` at-rule support for `toHaveStyleRule` and the snapshot serializer |
| 14 | +- Add opt-in CSS parse caching via `import 'jest-styled-components/cache'` (#235) |
| 15 | +- Normalize whitespace in value comparisons (`!important`, shorthand separators, commas) |
| 16 | +- Clearer validation messages: "Property not found" vs "Value mismatch" |
| 17 | +- Export `disableCSSCache` from `jest-styled-components/cache` |
| 18 | +- Use `Set` for O(1) hash lookups; serializer no longer mutates the parsed CSS AST |
23 | 19 |
|
24 | 20 | ## 7.3.0 |
25 | 21 |
|
|
0 commit comments