Skip to content

Commit

Permalink
polyfill esbuild-wasm with esbuild in jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shyguy1412 committed Mar 22, 2024
1 parent 2903489 commit fd414a2
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 0 deletions.
1 change: 1 addition & 0 deletions FixJSDOMEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export default class FixJSDOMEnvironment extends JSDOMEnvironment {
// Wrap the construction of the function in eval, so that transpilers
// don't touch the import() call.
this.global.importActual = eval("url => import(url)");
this.global.Uint8Array = Uint8Array;
}
}
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ module.exports = {
"^monaco-editor$": "<rootDir>/test/__mocks__/NullMock.js",
"^monaco-vim$": "<rootDir>/test/__mocks__/NullMock.js",
"/utils/Protections$": "<rootDir>/test/__mocks__/NullMock.js",
"ScriptTransform": "esbuild"
},
};
Loading

0 comments on commit fd414a2

Please sign in to comment.