Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ test-results.json
.vscode
codecov
.qodo
*.log
16 changes: 16 additions & 0 deletions jest.custom.env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// File introduced to fix the problem "Textdecoder is not defined" while running the tests
// Ref: https://github.com/jsdom/jsdom/issues/2524

/* eslint-disable @typescript-eslint/no-var-requires */
const Environment = require("jest-environment-jsdom");

module.exports = class CustomTestEnvironment extends Environment {
async setup() {
await super.setup();
if (typeof this.global.TextEncoder === "undefined") {
const { TextEncoder, TextDecoder } = require("util");
this.global.TextEncoder = TextEncoder;
this.global.TextDecoder = TextDecoder;
}
}
};
Loading
Loading