-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jest tests fail with "unexpected token" #8
Comments
@omgoshjosh The migration guide in the README goes over this. Quill >= 2.0 moves to native ES modules, and so ReactQuill did too. If your bundle doesn't support native ES modules, you will need to use babel to transpile it. It looks like you're using webpack with Your webpack config should look something like this:
with special note to the |
thanks for the response @VaguelySerious, i will keep banging my head on it! but yeah it actually works fine during local development with webpack... it is only with jest that it does not work... it seems like it's because we don't use webpack with jest to run tests, we use jest-babel which uses the same config as the babel-loader that webpack is using, but without all the overhead of webpack... maybe i need to update babel to use webpack which we avoided for a long time. |
Hmm, I can't tell you whether your jest setup needs webpack as a pre-processor, but it probably shouldn't? If you can't get the babel-loader to work well with jest, it might be worth a shot to migrate to |
thanks for the tip, i'll close this out for now. |
ok, so i have attempted a LOT of hoop jumping to no avail. is there any way we can bring back the build artifact? looking at quill... it doesn't seem like they stopped shipping build artifacts that are "plain js"... in other words, just using quill v2 does not have the same issue that react-quill v3 has now. when i've tried to make it work, i start running into all sorts of problems. for instance once i enable transform on react-quill, it starts complaining about quill and lodash (inside of react-quill). |
one more update with details as to what has gotten my first test to pass and now i'll have to look into the other 54 or so tests that are failing (they all seem to be the same issue, front end models not working on a call like
|
Apologies for the delayed response. I can see that using It looks like those assumptions weren't correct, so I just added back the standalone plain JS build in Please let me know if using |
Hello, I'm also running into this issue. I have a number of ignored modules in |
@alextenb Yes that's correct. If that doesn't work - let me know |
That didn't work for me, but omgoshjosh's final step did:
|
i noticed my builds were failing and when looking into it, jest and babel are having trouble and i think it's because of this change here: 1deb164#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L16
i am trying to get a code sandbox that shows the issue, but i am having trouble, so i wanted to get this issue open in the mean time.
Ticket due diligence
v2.0.0-beta.2
ReactQuill version
The text was updated successfully, but these errors were encountered: