ghost-telemetry-frontend/setupJest.js

10 lines
304 B
JavaScript
Raw Normal View History

// This file runs some code before a jest test.
// polyfill TextEncoder/TextDecoder since they aren't in jsdom:
const { TextEncoder, TextDecoder } = require('util');
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
// polyfill fetch since it's not in jsdom:
require('whatwg-fetch');