mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-07-28 04:08:05 +00:00
convert editor service to saga
This commit is contained in:
committed by
David Lechner
parent
5c3ec89e3b
commit
17cb5a32d5
+5
-1
@@ -1,12 +1,16 @@
|
||||
const Environment = require('jest-environment-jsdom');
|
||||
|
||||
/**
|
||||
* A custom environment to set the TextEncoder
|
||||
* A custom environment to set TextDecoder/TextEncoder
|
||||
* Thanks https://stackoverflow.com/a/57713960/1976323
|
||||
*/
|
||||
module.exports = class CustomTestEnvironment extends Environment {
|
||||
async setup() {
|
||||
await super.setup();
|
||||
if (typeof TextDecoder === 'undefined') {
|
||||
const { TextDecoder } = require('util');
|
||||
this.global.TextDecoder = TextDecoder;
|
||||
}
|
||||
if (typeof TextEncoder === 'undefined') {
|
||||
const { TextEncoder } = require('util');
|
||||
this.global.TextEncoder = TextEncoder;
|
||||
|
||||
Reference in New Issue
Block a user