Skip to content

@reach/utils: checkStyles warns in test environment #466

Open
@KubaJastrz

Description

@KubaJastrz

🐛 Bug report

Current Behavior

  console.warn node_modules/@reach/utils/dist/utils.cjs.development.js:64
    @reach/tabs styles not found. If you are using a bundler like webpack or parcel include this in the entry file of your app before any of your own styles:

        import "@reach/tabs/styles.css";
    import warning from 'warning';

      Otherwise you'll need to include them some other way:

        <link rel="stylesheet" type="text/css" href="node_modules/@reach/tabs/styles.css" />

      For more information visit https://ui.reach.tech/styling.

Expected behavior

No warning, because of the following line:

process.env.NODE_ENV !== "test" &&

It seems like the line is stripped in the cjs dist files.

Reproducible example

Suggested solution(s)

Additional context

Your environment

I'm using jest@25.1.0 with @babel/plugin-transform-modules-commonjs@7.8.3 (I don't remember why exactly I have this plugin, but I suspect this might be causing the issue, as in the esm dist file the line is not stripped).

Software Name(s) Version
Reach Package @reach/utils 0.8.2
React
Browser
Assistive tech
Node
npm/yarn
Operating System

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedExtra attention is neededType: EnhancementGeneral improvements or suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions