-
Notifications
You must be signed in to change notification settings - Fork 6
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 --env=jsdom TypeError: TextDecoder is not a constructor #10
Comments
@lidel this seems like the same issue as #1 (comment) do you mind checking if the same workaround works in this context as well ? |
Getting error when using it in the latest create web app with node v15.4.0. Does anyone know how to resolve this? System: |
hi, have you solved it? |
@mandyJiai no, I was not able to solve it. It seems that the issue was caused by using the ipfs-http-client library. Instead of using that library, I switched to using ipfs-api which still worked for my use case. |
@mandyJiai @dannyhchan as described in in this comment #1 (comment) issue is caused by jest and jsdom combination and not this library. It can be fixed by updating jest. |
jest
with--env=jsdom
fails withTypeError: TextDecoder is not a constructor
@Gozala did not dig into it, but I assume this is a bug: it is fair to expect people use
js-multiaddr
(which depends on web-encoding) in apps tested with jest.That's what we do in ipfs-webui – see below.
How to reproduce
Having below in
multibase/src/util.js
causes jest-based tests to fail in ipfs-webui:The text was updated successfully, but these errors were encountered: