Skip to content

Commit

Permalink
feat: project init
Browse files Browse the repository at this point in the history
  • Loading branch information
yeeun kang committed Jul 18, 2024
1 parent 439d7a3 commit 6d4f96e
Show file tree
Hide file tree
Showing 10 changed files with 2,372 additions and 11,419 deletions.
3 changes: 2 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
{
"setupFiles" : ["./jest.setup.ts"],
"clearMocks": true,
"coverageDirectory": "coverage",
"collectCoverage": true,
Expand Down
23 changes: 23 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// jest.setup.js
import { TextDecoder, TextEncoder } from 'node:util';
import { ReadableStream, TransformStream } from 'node:stream/web';

Object.defineProperties(globalThis, {
TextDecoder: { value: TextDecoder },
TextEncoder: { value: TextEncoder },
ReadableStream: { value: ReadableStream },
TransformStream: { value: TransformStream },
});

import { Blob, File } from 'node:buffer';
import { fetch, Headers, FormData, Request, Response } from 'undici';

Object.defineProperties(globalThis, {
fetch: { value: fetch, writable: true },
Blob: { value: Blob },
File: { value: File },
Headers: { value: Headers },
FormData: { value: FormData },
Request: { value: Request },
Response: { value: Response },
});
Loading

0 comments on commit 6d4f96e

Please sign in to comment.