Skip to content

Commit e5d1b88

Browse files
authored
Bug/fix nextjs adapter functional tests (#305)
1 parent e8f93d2 commit e5d1b88

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

packages/@apphosting/adapter-nextjs/e2e/app.spec.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,14 @@ describe("app", () => {
1212
const response = await fetch(host);
1313
assert.ok(response.ok);
1414
assert.equal(response.headers.get("content-type")?.toLowerCase(), "text/html; charset=utf-8");
15-
assert.equal(
16-
response.headers.get("cache-control"),
17-
"s-maxage=31536000, stale-while-revalidate",
18-
);
15+
assert.equal(response.headers.get("cache-control"), "s-maxage=31536000, ");
1916
});
2017

2118
it("/ssg", async () => {
2219
const response = await fetch(posix.join(host, "ssg"));
2320
assert.ok(response.ok);
2421
assert.equal(response.headers.get("content-type")?.toLowerCase(), "text/html; charset=utf-8");
25-
assert.equal(
26-
response.headers.get("cache-control"),
27-
"s-maxage=31536000, stale-while-revalidate",
28-
);
22+
assert.equal(response.headers.get("cache-control"), "s-maxage=31536000, ");
2923
const text = await response.text();
3024
assert.ok(text.includes("SSG"));
3125
assert.ok(text.includes("Generated"));
@@ -80,10 +74,7 @@ describe("app", () => {
8074
const response = await fetch(posix.join(host, "isr", "demand"));
8175
assert.ok(response.ok);
8276
assert.equal(response.headers.get("content-type")?.toLowerCase(), "text/html; charset=utf-8");
83-
assert.equal(
84-
response.headers.get("cache-control"),
85-
"s-maxage=31536000, stale-while-revalidate",
86-
);
77+
assert.equal(response.headers.get("cache-control"), "s-maxage=31536000, ");
8778
const text = await response.text();
8879
assert.ok(text.includes("A cached page"));
8980
assert.ok(text.includes("Generated"));

packages/@apphosting/adapter-nextjs/e2e/run-local.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const run = spawn(runScript, runArgs, {
7070
env: {
7171
NODE_ENV: "production",
7272
PORT: port.toString(),
73+
PATH: process.env.PATH,
7374
},
7475
});
7576
run.stderr.on("data", (data) => console.error(data.toString()));

starters/nextjs/basic/.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { FlatCompat } from "@eslint/eslintrc";
2+
const compat = new FlatCompat({
3+
// import.meta.dirname is available after Node.js v20.11.0
4+
baseDirectory: import.meta.dirname,
5+
});
6+
const eslintConfig = [
7+
...compat.config({
8+
extends: ["next/core-web-vitals"],
9+
}),
10+
];
11+
export default eslintConfig;

0 commit comments

Comments
 (0)