Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed May 18, 2024
1 parent efb70f7 commit 1e9a23a
Showing 1 changed file with 1 addition and 55 deletions.
56 changes: 1 addition & 55 deletions packages/sst/test/constructs/NextjsSite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,13 @@ test("default: check cache policy configured correctly", async () => {
CachePolicyConfig: objectLike({
ParametersInCacheKeyAndForwardedToOrigin: objectLike({
HeadersConfig: objectLike({
Headers: arrayWith(["accept"]),
Headers: arrayWith(["x-open-next-cache-key"]),
}),
}),
}),
});
});

test("buildDefaultServerCachePolicyProps", () => {
expect(NextjsSite.buildDefaultServerCachePolicyProps()).toEqual(
expect.objectContaining({
headerBehavior: {
behavior: "whitelist",
headers: expect.arrayContaining(["accept"]),
},
})
);
});

test("timeout defined", async () => {
const { stack } = await createSite({
timeout: 100,
Expand All @@ -120,49 +109,6 @@ test("timeout defined", async () => {
});
});

test("experimental.streaming undefined", async () => {
const { stack } = await createSite();
hasResource(stack, "AWS::Lambda::Url", {
InvokeMode: "BUFFERED",
});
});
test("experimental.streaming true", async () => {
const { stack } = await createSite({
experimental: {
streaming: true,
},
});
hasResource(stack, "AWS::Lambda::Url", {
InvokeMode: "RESPONSE_STREAM",
});
});

test("experimental.disableIncrementalCache undefined", async () => {
const { stack } = await createSite();
countResources(stack, "AWS::SQS::Queue", 1);
});
test("experimental.disableIncrementalCache true", async () => {
const { stack } = await createSite({
experimental: {
disableIncrementalCache: true,
},
});
countResources(stack, "AWS::SQS::Queue", 0);
});

test("experimental.disableDynamoDBCache undefined", async () => {
const { stack } = await createSite();
countResources(stack, "AWS::DynamoDB::GlobalTable", 1);
});
test("experimental.disableDynamoDBCache true", async () => {
const { stack } = await createSite({
experimental: {
disableDynamoDBCache: true,
},
});
countResources(stack, "AWS::DynamoDB::GlobalTable", 0);
});

test("cdk.distribution.defaultBehavior", async () => {
const { stack, site } = await createSite({
cdk: {
Expand Down

0 comments on commit 1e9a23a

Please sign in to comment.