Skip to content

Commit

Permalink
fix: set customExportConditions to [''] (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito authored Nov 13, 2024
1 parent 5d32aa6 commit e136f35
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ class FixedJSDOMEnvironment extends JSDOMEnvironment {
constructor(...args) {
super(...args)

/**
* @note Opt-out from JSDOM using browser-style resolution
* for dependencies. This is simply incorrect, as JSDOM is
* not a browser, and loading browser-oriented bundles in
* Node.js will break things.
*
* Consider migrating to a more modern test runner if you
* don't want to deal with this.
*/
this.customExportConditions = args.customExportConditions || ['']

this.global.TextDecoder = TextDecoder
this.global.TextEncoder = TextEncoder
this.global.TextDecoderStream = TextDecoderStream
Expand Down

0 comments on commit e136f35

Please sign in to comment.