mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-03-15 17:11:07 +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;
|
|
}
|
|
}
|
|
};
|