Skip to content

Commit

Permalink
Run all the suites before erroring
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels committed May 16, 2024
1 parent e2c0918 commit 18b820d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/@apphosting/adapter-angular/e2e/csr/basics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ describe(`client-side (SSR ${ssr ? "enabled" : "disabled"})`, () => {
it("/", async () => {
const response = await fetch(host);
assert.ok(response.ok);
assert.equal(response.headers.get("content-type"), "text/html; charset=utf-8");
assert.equal(response.headers.get("content-type")?.toLowerCase(), "text/html; charset=utf-8");
assert.equal(response.headers.get("cache-control"), null);
});

it("/ssg", async () => {
const response = await fetch(posix.join(host, "ssg"));
assert.ok(response.ok);
assert.equal(response.headers.get("content-type"), "text/html; charset=utf-8");
assert.equal(response.headers.get("content-type")?.toLowerCase(), "text/html; charset=utf-8");
assert.equal(response.headers.get("cache-control"), null);
});

Expand All @@ -33,7 +33,7 @@ describe(`client-side (SSR ${ssr ? "enabled" : "disabled"})`, () => {
it("/deferrable-views", async () => {
const response = await fetch(posix.join(host, "deferrable-views"));
assert.ok(response.ok);
assert.equal(response.headers.get("content-type"), "text/html; charset=utf-8");
assert.equal(response.headers.get("content-type")?.toLowerCase(), "text/html; charset=utf-8");
assert.equal(response.headers.get("cache-control"), null);
});
});
14 changes: 10 additions & 4 deletions packages/@apphosting/adapter-angular/e2e/run-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
const buildScript = join(__dirname, "../dist/bin/build.js");
const angularJSON = JSON.parse((await readFile(join(cwd, "angular.json"))).toString());

try {
for (const enableSSR of [false, true]) {
const errors = [];

for (const enableSSR of [false, true]) {
try {
angularJSON.projects["firebase-app-hosting-angular"].architect.build.options.ssr =
enableSSR && {
entry: "server.ts",
Expand Down Expand Up @@ -88,9 +90,13 @@ try {
run.stdin.end();
run.kill("SIGKILL");
});
} catch (e) {
errors.push(e);
}
} catch (e) {
console.error(e);
}

if (errors.length) {
console.error(errors);
process.exit(1);
}

Expand Down

0 comments on commit 18b820d

Please sign in to comment.