Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Esm corrupts jest's exported constructor. #482

Closed
Pokute opened this issue Jun 28, 2018 · 1 comment
Closed

Esm corrupts jest's exported constructor. #482

Pokute opened this issue Jun 28, 2018 · 1 comment
Labels

Comments

@Pokute
Copy link

Pokute commented Jun 28, 2018

I found this bug when trying to tweak create-react-app -made app's tests. The code works properly without -r esm and fails really weirdly with it. It seems that while it runs the right constructor function properly, the resulting object doesn't have the correct prototype. I don't think that react (or react-create-app' is crucial for this test case, but it's this one is less than a minute to set up.

To test:
npx create-react-app esm-crats-test --scripts-version=react-scripts-ts
cd esm-crats-test
git init (forgot this initially)
yarn add esm

Run yarn run test to verify that non-esm version works properly. Quit test with q.

Run ./node_modules/react-scripts-ts/bin/react-scripts-ts.js -r esm test --env=jsdom which will fail.

@jdalton
Copy link
Member

jdalton commented Jun 28, 2018

Thanks @Pokute!

Your repro was perfect. I know around-abouts where the issue is.

Update:

v3.0.57 is released 🎉

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

No branches or pull requests

2 participants