Skip to content

Commit

Permalink
chore: appFixture.close isnt async anymore
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <logan@mcan.sh>
  • Loading branch information
mcansh committed Dec 8, 2022
1 parent a1515a6 commit 2183c51
Show file tree
Hide file tree
Showing 30 changed files with 68 additions and 72 deletions.
4 changes: 2 additions & 2 deletions integration/abort-signal-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ test.beforeAll(async () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("should not abort the request in a new event loop", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/action-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ test.describe("actions", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

let logs: string[] = [];
Expand Down
4 changes: 2 additions & 2 deletions integration/bug-report-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ test.beforeAll(async () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions integration/catch-boundary-data-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ test.beforeAll(async () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("renders root boundary with data available", async () => {
Expand Down
4 changes: 2 additions & 2 deletions integration/catch-boundary-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ test.describe("CatchBoundary", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("non-matching urls on document requests", async () => {
Expand Down
4 changes: 2 additions & 2 deletions integration/compiler-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ test.describe("compiler", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("removes server code with `*.server` files", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/error-boundary-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ test.describe("ErrorBoundary", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
test.afterAll(() => {
console.error = _consoleError;
await appFixture.close();
appFixture.close();
});

test("invalid request methods", async () => {
Expand Down
4 changes: 2 additions & 2 deletions integration/error-data-request-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ test.describe("ErrorBoundary", () => {
errorLogs = [];
});

test.afterAll(async () => {
test.afterAll(() => {
console.error = _consoleError;
await appFixture.close();
appFixture.close();
});

function assertConsoleError(str: string) {
Expand Down
4 changes: 2 additions & 2 deletions integration/fetcher-layout-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ test.beforeAll(async () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("fetcher calls layout route action when at index route", async ({
Expand Down
4 changes: 2 additions & 2 deletions integration/fetcher-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ test.describe("useFetcher", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test.describe("No JavaScript", () => {
Expand Down
4 changes: 2 additions & 2 deletions integration/file-uploads-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ test.describe("file-uploads", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("handles files under upload size limit", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/form-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ test.describe("Forms", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test.describe("without JavaScript", () => {
Expand Down
8 changes: 2 additions & 6 deletions integration/helpers/create-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,8 @@ export async function createAppFixture(fixture: Fixture, mode?: ServerMode) {
* `beforeAll` block. Also make sure to `await app.close()` or else you'll
* have memory leaks.
*/
close: async () => {
try {
return stop();
} catch (error) {
throw error;
}
close: () => {
return stop();
},
};
};
Expand Down
4 changes: 2 additions & 2 deletions integration/hook-useSubmit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ test.describe("`useSubmit()` returned function", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("submits the submitter's value appended to the form data", async ({
Expand Down
4 changes: 2 additions & 2 deletions integration/js-routes-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ test.describe(".js route files", () => {
);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("should render all .js routes", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/layout-route-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ test.describe("pathless layout routes", () => {
);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("should render pathless index route", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/link-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ test.describe("route module link export", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("adds responsive image preload links to the document", async ({
Expand Down
4 changes: 2 additions & 2 deletions integration/loader-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ test.describe("loader in an app", () => {
);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("sends a redirect", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/mdx-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export function ComponentUsingData() {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("can render basic markdown", async ({ page }) => {
Expand Down
8 changes: 4 additions & 4 deletions integration/meta-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ test.describe("meta", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("empty meta does not render a tag", async ({ page }) => {
Expand Down Expand Up @@ -477,8 +477,8 @@ test.describe("v2_meta", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("empty meta does not render a tag", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/multiple-cookies-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ test.describe("pathless layout routes", () => {
);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("should get multiple cookies from the loader", async ({ page }) => {
Expand Down
16 changes: 8 additions & 8 deletions integration/prefetch-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ test.describe("prefetch=none", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("does not render prefetch tags during SSR", async ({ page }) => {
Expand All @@ -109,8 +109,8 @@ test.describe("prefetch=render", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("does not render prefetch tags during SSR", async ({ page }) => {
Expand Down Expand Up @@ -151,8 +151,8 @@ test.describe("prefetch=intent (hover)", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("does not render prefetch tags during SSR", async ({ page }) => {
Expand Down Expand Up @@ -222,8 +222,8 @@ test.describe("prefetch=intent (focus)", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("does not render prefetch tags during SSR", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/redirects-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ test.describe("redirects", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("preserves revalidation across action multi-redirects", async ({
Expand Down
4 changes: 2 additions & 2 deletions integration/rendering-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ test.describe("rendering", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("server renders matching routes", async () => {
Expand Down
4 changes: 2 additions & 2 deletions integration/resource-routes-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ test.describe("loader in an app", async () => {
appFixture = await createAppFixture(fixture, ServerMode.Test);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test.describe("with JavaScript", () => {
Expand Down
4 changes: 2 additions & 2 deletions integration/server-code-in-browser-message-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ test.beforeAll(async () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test.skip("should log relevant error message", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/set-cookie-revalidation-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ test.beforeAll(async () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("should revalidate when cookie is set on redirect from loader", async ({
Expand Down
4 changes: 2 additions & 2 deletions integration/transition-state-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ test.describe("rendering", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("transitions to normal load (Loading)", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/transition-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ test.describe("rendering", () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("calls all loaders for new routes", async ({ page }) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/upload-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ test.beforeAll(async () => {
appFixture = await createAppFixture(fixture);
});

test.afterAll(async () => {
await appFixture.close();
test.afterAll(() => {
appFixture.close();
});

test("can upload a file with createFileUploadHandler", async ({ page }) => {
Expand Down

0 comments on commit 2183c51

Please sign in to comment.