Closed Pet3ris closed 3 years ago
Sorry, I'm not familiar with Jest, but https://github.com/facebook/jest/issues/2550#issuecomment-810144368 is the right place to ask your question.
It looks like using @Pet3ris' solution after upgrading to browser-fs-access v0.18.1 solves the issue. (#55)
I tried to use the following configuration parameter to account for presence of
mjs
files but still getting the same error. Any thoughts on how to allow jest to successfully compilebrowser-fs-access
?"transformIgnorePatterns": [ "node_modules/(?!browser-fs-access).+(js|jsx|mjs|ts)$" ]
To my great shame, I had to resort to bundling this package to commonjs.
I’m not really into bundling, but I know there’s a way to publish several builds in the same package.json
. If you know how this works, maybe I could ask you to contribute this back, so others can profit and you don’t have to keep your fork in sync as new stuff gets added?!
Happy to do so! The fork uses esbuild to bundle into ESM and CJS modules, which I think is what you're describing too. The only modifications were replacing your slick for await
loops with regular loops because esbuild can't parse those yet.
Awesome, thanks a ton! I have created https://github.com/GoogleChromeLabs/browser-fs-access/issues/82 to track this.
It appears that the transformIgnorePatterns
workaround is still needed. Am I missing something? package.json
doesn't seem to reference the cjs
version anywhere.
We may want to revisit bundling. It looks like microbundle is the current go-to option. I have opened https://github.com/GoogleChromeLabs/browser-fs-access/issues/94 to track this. If you have time, feel free to work on a PR that fixes this, but else, I'll also eventually get to it, but need to deal with things that popped up during my recent time off.
Hi There,
I'm using jest for testing and having trouble with importing the
browser-fs-access
library.This seems to be a common issue, documented here: https://github.com/facebook/jest/issues/2550, however, the common solutions don't work.
I tried to use the following configuration parameter to account for presence of
mjs
files but still getting the same error. Any thoughts on how to allow jest to successfully compilebrowser-fs-access
?