# styled-components/jest-styled-components

🔧 💅 Jest utilities for Styled Components

Repository: https://github.com/styled-components/jest-styled-components
Canonical: https://ross.abutalabs.com/products/jest-styled-components
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-06-29T22:16:53+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 90, release rhythm 77, longevity 100
- inputs: {"age_days": 3455, "days_push": 65, "days_rel": 159, "gap_med": 2.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1580, forks 144 (observed 2026-08-28T04:05:06.894892+00:00)

## What it is
A testing utility library for styled-components that improves Jest, Vitest, and Bun snapshot testing by inlining readable CSS rules into snapshots and adding a toHaveStyleRule matcher. It replaces opaque hashed class names with deterministic placeholders so style diffs are meaningful.

## Use cases
- test styled-components CSS in jest snapshots
- assert a component has a specific style rule
- make styled-components snapshot diffs readable
- run styled-components tests with vitest or bun
- avoid meaningless class name changes in snapshot diffs
- test react native styled-components styles

## When to choose
- you use styled-components v5+ and Jest, Vitest, or Bun for testing
- your styled-components snapshots are full of hashed class names and unreadable diffs
- you need to assert specific CSS values on styled components

## When to avoid
- you don't use styled-components or another css-in-js library
- you use a test runner other than Jest, Vitest, or Bun
- you rely on legacy Enzyme-based testing workflows

## Facets
- artifact type: library
- maturity: active
- function: testing, e2e-testing
- domain: testing, frontend, web-development, developer-tools
- platform: bun, cli
- tags: jest, vitest, styled-components, snapshot-testing, css-in-js, react, custom-matcher, nodejs

## Member repositories
- styled-components/jest-styled-components (main) score 87

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:06.894892+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:56:37.844693+00:00, confidence not recorded.
  - readme: https://github.com/styled-components/jest-styled-components (fetched 2026-08-28T04:05:06.894892+00:00, sha 10247030e944)
  - registry_npm: https://registry.npmjs.org/jest-styled-components (fetched 2026-08-29T11:27:06.023603+00:00, sha 05e294d07180)
- Data as of 2026-08-30T08:39:29.467469+00:00.
