Skip to content

Commit

Permalink
Simplify declaration
Browse files Browse the repository at this point in the history
To be honest I'm not sure why this is valid (TS has no way of knowing
that the beforeAll callback gets called before the others?) but hey, it
works and if it's ever not valid tests would fail.
  • Loading branch information
glasser committed Nov 21, 2022
1 parent 69b2d1e commit 56684d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/integration-testsuite/src/httpSpecTests.ts
Expand Up @@ -10,7 +10,7 @@ export function defineIntegrationTestSuiteHttpSpecTests(
createServer: CreateServerForIntegrationTests,
) {
describe('httpSpecTests.ts', () => {
let createServerResult: CreateServerForIntegrationTestsResult | null = null;
let createServerResult: CreateServerForIntegrationTestsResult;

beforeAll(async () => {
createServerResult = await createServer({
Expand All @@ -23,12 +23,12 @@ export function defineIntegrationTestSuiteHttpSpecTests(
});

afterAll(async () => {
await createServerResult?.server.stop();
await createServerResult?.extraCleanup?.();
await createServerResult.server.stop();
await createServerResult.extraCleanup?.();
});

for (const audit of serverAudits({
url: () => createServerResult!.url,
url: () => createServerResult.url,
fetchFn: fetch,
})) {
test(audit.name, async () => {
Expand Down

0 comments on commit 56684d9

Please sign in to comment.