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

Commit cd8e99a

Browse files
committed
Fix cypress:local: Skip test for cache control header
The cache control header in netlify dev does not include "public" for static assets. This is unlike netlify.app. We should probably set headers in a _headers file as suggested by: #110 For now, we simply skip the test when running the Cypress tests locally.
1 parent 818cb91 commit cd8e99a

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)