convert editor service to saga

This commit is contained in:
David Lechner
2020-06-10 21:59:34 -05:00
committed by David Lechner
parent 5c3ec89e3b
commit 17cb5a32d5
5 changed files with 86 additions and 46 deletions
+5 -1
View File
@@ -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;