Skip to content

Sass support in jest test files appear to be broken #4345

Closed
@Tasemu

Description

@Tasemu

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

(Write your answer here.)

Which terms did you search for in User Guide?

Sass support

(Write your answer here if relevant.)

Environment

  1. node -v:
  2. npm -v:
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected):

Then, specify:

  1. Operating system:
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

1: Update react-scripts to latest release
2: Import styles from 'component.module.scss' in component file
3: Import styles from 'component.module.scss' in component.test.js

Expected Behavior

(Write what you thought would happen.)

Classnames are imported for component file and test file correctly for comparison

see #3815

Actual Behavior

(Write what happened. Please add screenshots!)

Component imports classNames correctly, test file classnames are undefined

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions