Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !10337

Add section on testing component CSS with Jest

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/tarikhamilton/patch-1 into main Jan 05, 2021
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: tarikhamilton

jsdom isn't ideal (or suitable?) for testing component style, but it isn't super obvious as it really isn't explicitly stated anywhere in create-react-app, jest, or react-testing-library docs.

CRA is designed to get people started with React and is somewhat of a closed system with it not exposing its webpack config, so I think it is useful to explicitly state that it isn't supported out of the box, as well as a nice nudge to encourage someone to try a different approach.

I know there are ways to do it, but it seemed out of scope, which is why I stuck to this simple caveat.

It's a harmless addition that could save someone time. Maybe this was just a "me" problem, but I tripped up on it enough to want to add this to the docs, and I've used CRA for years (just never tried to test a style!). Thoughts?

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/tarikhamilton/patch-1