mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-02 13:53:12 +00:00
13 lines
387 B
JavaScript
13 lines
387 B
JavaScript
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;
|
|
}
|
|
}
|
|
};
|