reach/reach-ui

@reach/utils: `checkStyles` warns in test environment

Open

#466 opened on Feb 13, 2020

View on GitHub
 (4 comments) (0 reactions) (0 assignees)TypeScript (558 forks)auto 404
Help WantedType: Enhancement

Repository metrics

Stars
 (5,975 stars)
PR merge metrics
 (PR metrics pending)

Description

🐛 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: https://github.com/reach/reach-ui/blob/5977a9c0a4c14b9d5a179b996fabafbab987153e/packages/utils/src/index.tsx#L73

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

Contributor guide