Skip to content

Babel error when running tests with --coverage #1196

Closed
@gaelollivier

Description

@gaelollivier

Description

Steps:

  • create a fresh app
  • anywhere inside App.js, add the following code
function* test() {
  yield ((a) => 42)
}
  • run npm run test => works
  • run npm run test -- --coverage => crashes

Expected behavior

This syntax is valid js, it works in the browser and with tests without coverage so I expect it to work with coverage activated

Actual behavior

This error is thrown:
image

Environment

  1. npm ls react-scripts
[email protected] /Users/gael/Desktop/test
└── [email protected]
  1. node -v:
v6.4.0
  1. npm -v:
3.10.6
  1. Operating system: OSX 10.12.1
  2. Browser and version: N/A

I guess this is a Jest issue, so I ping @cpojer ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions