mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-03-15 15:30:49 +00:00
15 lines
521 B
JavaScript
15 lines
521 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;
|
||
|
this.global.Uint8Array = Uint8Array;
|
||
|
this.global.ArrayBuffer = ArrayBuffer;
|
||
|
}
|
||
|
}
|
||
|
};
|