Skip to content

Commit

Permalink
📸 Define TextEncoder, TextDecoder in all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shaldengeki committed Dec 23, 2024
1 parent c5d3c4b commit 6ea59d1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ark_nova_stats/frontend/src/setupTests.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import '@testing-library/jest-dom'
import { jest } from '@jest/globals';
import { TextEncoder, TextDecoder } from 'util';

global.jest = jest;

Object.defineProperty(window, 'TextEncoder', {
writable: true,
value: TextEncoder
});

Object.defineProperty(window, 'TextDecoder', {
writable: true,
value: TextDecoder
});
11 changes: 11 additions & 0 deletions fitbit_challenges/frontend/src/setupTests.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import '@testing-library/jest-dom'
import { jest } from '@jest/globals';
import { TextEncoder, TextDecoder } from 'util';

global.jest = jest;

Object.defineProperty(window, 'TextEncoder', {
writable: true,
value: TextEncoder
});

Object.defineProperty(window, 'TextDecoder', {
writable: true,
value: TextDecoder
});
11 changes: 11 additions & 0 deletions skeleton/frontend/src/setupTests.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import '@testing-library/jest-dom'
import { jest } from '@jest/globals';
import { TextEncoder, TextDecoder } from 'util';

global.jest = jest;

Object.defineProperty(window, 'TextEncoder', {
writable: true,
value: TextEncoder
});

Object.defineProperty(window, 'TextDecoder', {
writable: true,
value: TextDecoder
});

0 comments on commit 6ea59d1

Please sign in to comment.