Skip to content

"react-scripts test" fails for valid JS files from modules which are successfully built #5164

Description

@dmythro

Is this a bug report?

Yes

Environment

Environment:
OS: macOS High Sierra 10.13.6
Node: 10.8.0
Yarn: 1.10.1
npm: 6.2.0
Watchman: 4.9.0
Xcode: Xcode 10.0 Build version 10A255
Android Studio: Not Found
Packages: (wanted => installed)
react: ~16.5.0 => 16.5.2
react-dom: ~16.5.0 => 16.5.2
react-scripts: ^2.0.1 => 2.0.1

Steps to Reproduce

  1. Add any module via git (test one: z-ax/test-next-module)
  2. Add there a valid JS file which has import something from 'something'
  3. Add a simple valid test which uses a file from this module (test one: z-ax/test-next)
  4. Run react-scripts build (all good)
  5. Run react-scripts test --verbose (test with this import fails)

Expected Behavior

Build passes.
Test passes.

Actual Behavior

Build passes.
Test fails because of SyntaxError: Unexpected identifier, pointing to import.

Linking with #5103.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions