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 4 years ago
  • 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?

Activity

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
  1. 05 Jan, 2021 1 commit
    • Tarik Hamilton's avatar
      Add section on testing component CSS with Jest · 02b99816
      Tarik Hamilton authored 4 years ago
      jsdom isn't ideal for testing component CSS, but it isn't super obvious.
      Unverified
      02b99816
0 Assignees
None
Assign to
0 Reviewers
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
Lock merge request
Unlocked
participants
Reference:
Source branch: github/fork/tarikhamilton/patch-1