Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

.mjs files in node_modules break jest #287

Closed
@mbrowne

Description

@mbrowne

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Environment

All environments

Steps to Reproduce

  1. yarn add graphql@0.13.2 @types/graphql

  2. Add the following code to App.tsx:

     import { graphql } from 'graphql'
     console.log(graphql)
    
  3. yarn test -t 'renders without crashing'

Expected Behavior

Test should pass

Actual Behavior

 FAIL  src/App.test.tsx
  ● Test suite failed to run

    /Users/mbrowne/_temp/test-app/node_modules/graphql/index.mjs:2
    export { graphql, graphqlSync } from './graphql';
    ^^^^^^

    SyntaxError: Unexpected token export

Solution

This is a known bug in create-react-app. The fix should be simple: simply merge this PR into this repo (it was already merged into the official create-react-app).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions