Skip to content

Commit

Permalink
fix(jest): error TextEncoder is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Badisi committed Apr 16, 2024
1 parent 5fbb3ba commit da75117
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions projects/ngx-auth/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import { TextDecoder, TextEncoder } from 'node:util';

// @ts-expect-error https://mswjs.io/docs/migrations/1.x-to-2.x#requestresponsetextencoder-is-not-defined-jest
globalThis.TextDecoder = TextDecoder;
globalThis.TextEncoder = TextEncoder;

// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
Expand Down

0 comments on commit da75117

Please sign in to comment.