feat: major UI/UX overhaul, snippets system, and performance fixes
Some checks failed
Dev Deployment (Zero Downtime) / deploy-dev (push) Failing after 9m26s
Some checks failed
Dev Deployment (Zero Downtime) / deploy-dev (push) Failing after 9m26s
This commit is contained in:
@@ -31,15 +31,15 @@ Object.defineProperty(window, "IntersectionObserver", {
|
||||
|
||||
// Polyfill Headers/Request/Response
|
||||
if (!global.Headers) {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error - Polyfilling global Headers for jest environment
|
||||
global.Headers = Headers;
|
||||
}
|
||||
if (!global.Request) {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error - Polyfilling global Request for jest environment
|
||||
global.Request = Request;
|
||||
}
|
||||
if (!global.Response) {
|
||||
// @ts-ignore
|
||||
// @ts-expect-error - Polyfilling global Response for jest environment
|
||||
global.Response = Response;
|
||||
}
|
||||
|
||||
@@ -49,13 +49,14 @@ jest.mock('next/server', () => {
|
||||
return {
|
||||
...actual,
|
||||
NextResponse: {
|
||||
json: (data: any, init?: any) => {
|
||||
const res = new Response(JSON.stringify(data), init);
|
||||
json: (data: Record<string, unknown>, init?: unknown) => {
|
||||
// Use global Response from whatwg-fetch
|
||||
const res = new (global as any).Response(JSON.stringify(data), init);
|
||||
res.headers.set('Content-Type', 'application/json');
|
||||
return res;
|
||||
},
|
||||
next: () => ({ headers: new Headers() }),
|
||||
redirect: (url: string) => ({ headers: new Headers(), status: 302 }),
|
||||
redirect: (_url: string) => ({ headers: new Headers(), status: 302 }),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user