Skip to content

Commit 14c5be3

Browse files
committed
fix test and patchedAsyncStorage
1 parent 3735c52 commit 14c5be3

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

packages/open-next/src/build/patch/patchedAsyncStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const staticGenerationAsyncStorage = {
1010
if (store) {
1111
store.isOnDemandRevalidate =
1212
store.isOnDemandRevalidate &&
13-
!globalThis.__als.getStore().isISRRevalidation;
13+
!globalThis.__openNextAls.getStore().isISRRevalidation;
1414
}
1515
return store;
1616
},

packages/tests-unit/tests/adapters/cache.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import S3Cache, { hasCacheExtension } from "@opennextjs/aws/adapters/cache.js";
33
import { vi } from "vitest";
44

5+
declare global {
6+
var disableIncrementalCache: boolean;
7+
var isNextAfter15: boolean;
8+
}
9+
510
describe("hasCacheExtension", () => {
611
it("Should returns true if has an extension and it is a CacheExtension", () => {
712
expect(hasCacheExtension("hello.cache")).toBeTruthy();
@@ -51,7 +56,7 @@ describe("S3Cache", () => {
5156
};
5257
globalThis.tagCache = tagCache;
5358

54-
globalThis.__als = {
59+
globalThis.__openNextAls = {
5560
getStore: vi.fn().mockReturnValue({
5661
requestId: "123",
5762
pendingPromiseRunner: {

packages/tests-unit/tests/core/routing/util.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ vi.mock("@opennextjs/aws/adapters/config/index.js", () => ({
2626
}));
2727

2828
declare global {
29-
var __als: any;
29+
var __openNextAls: any;
3030
var lastModified: any;
3131
var openNextDebug: boolean;
3232
var openNextVersion: string;
@@ -531,7 +531,7 @@ describe("addOpenNextHeader", () => {
531531
delete config.NextConfig["poweredByHeader"];
532532
globalThis.openNextDebug = false;
533533
globalThis.openNextVersion = "1.0.0";
534-
globalThis.__als = {
534+
globalThis.__openNextAls = {
535535
getStore: () => ({
536536
requestId: "123",
537537
}),
@@ -583,7 +583,7 @@ describe("revalidateIfRequired", () => {
583583
name: "mock",
584584
};
585585

586-
globalThis.__als = {
586+
globalThis.__openNextAls = {
587587
getStore: vi.fn(),
588588
};
589589

@@ -628,7 +628,7 @@ describe("revalidateIfRequired", () => {
628628
describe("fixISRHeaders", () => {
629629
beforeEach(() => {
630630
vi.useFakeTimers().setSystemTime("2024-01-02T00:00:00Z");
631-
globalThis.__als = {
631+
globalThis.__openNextAls = {
632632
getStore: () => ({
633633
requestId: "123",
634634
}),

0 commit comments

Comments
 (0)