Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Commit 5ffce26

Browse files
committed
Merge branch 'fix-cypress-local-cache-control' into main (#118)
This fixes a failing test when running npm run cypress:local. The failing test is testing the cache control header of a pre-rendered, static page and expecting the headers to include "public". This is the case on netlify.app. However, in netlify dev this cache control header is not present, causing the test to fail. For now, we simply skip the test when running the Cypress tests locally (as we do in default_spec.js). In the long term, we should probably set headers in a _headers file as suggested by #110.
2 parents 818cb91 + cd8e99a commit 5ffce26

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cypress/integration/optionalCatchAll_at_root_spec.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ describe("pre-rendered pages: /subfolder/[id].js", () => {
104104
});
105105

106106
it("serves the pre-rendered HTML (and not the Netlify Function)", () => {
107-
cy.request("/subfolder/static").then((response) => {
108-
expect(response.headers["cache-control"]).to.include("public");
109-
});
107+
if (Cypress.env("DEPLOY") !== "local") {
108+
cy.request("/subfolder/static").then((response) => {
109+
expect(response.headers["cache-control"]).to.include("public");
110+
});
111+
}
110112
});
111113
});
112114

0 commit comments

Comments
 (0)