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

Code splitting breaks jest tests. #425

Open
nico-bellante opened this issue Oct 17, 2018 · 0 comments
Open

Code splitting breaks jest tests. #425

nico-bellante opened this issue Oct 17, 2018 · 0 comments

Comments

@nico-bellante
Copy link

Is this a bug report?

On the border of bug report and feature request.

I have a React application that I am using code-splitting in. When the component that does said code-splitting is mounted in a jest test, I get the following error:
import' and 'export' may only appear at the top level

After searching the web, I found some people fixing this problem by using the dynamic-import-node babel plugin.

I then searched this repo to see if I could find any way to specify for ts-jest's babel to use this plugin, and I was unsuccessful.

Is there a way to do this that I missed? Should this be included by default?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant