Closed Moumouls closed 3 years ago
I originally fixed this with browser's custom jest-environment.js. Is this no longer working? Unit tests are still passing in this library, so is this PR to fix issues with your Jest setup?
I originally fixed this with browser's custom jest-environment.js. Is this no longer working? Unit tests are still passing in this library, so is this PR to fix issues with your Jest setup?
In this library it works, but not in other projects (e.g. Parse SDK JS). This error happened in Parse SDK JS unit tests. The solution with custom jest env will work, but it seems to me more appropriate also to avoid this error by just doing an import 😃 Also i don't know when jest will add the support of TextEncoder into the JSdom.
@Moumouls I don't know why I resisted this for so long - thank you for helping make this library more pleasant to integrate 😅
This has been published to NPM as browser@0.10.6
Found an issue during some JSDOM Jest tests.
TextEncoder is not currently supported correctly into
jsdom
env of Jest.To avoid a systemic crash at import time it's better to init text encoder into the function.
A workaround is to use the
node
env of Jest. But some tests require jsdom and could import indirectly the package.