Skip to content

Commit

Permalink
fix: suppress false positive linter error on globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber committed Dec 2, 2024
1 parent da7ab9e commit cf33987
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ import '@testing-library/jest-dom';
// Work around https://github.com/remix-run/react-router/issues/12363
// Remove this once https://github.com/jsdom/jsdom/pull/3791 is fixed

/* eslint-disable no-undef */

globalThis.IS_REACT_ACT_ENVIRONMENT = true;

if (!globalThis.TextEncoder || !globalThis.TextDecoder) {
const { TextDecoder, TextEncoder } = require('node:util');
globalThis.TextEncoder = TextEncoder;
globalThis.TextDecoder = TextDecoder;
}

/* eslint-enable no-undef */

0 comments on commit cf33987

Please sign in to comment.