Skip to content

Commit

Permalink
catch errors in beforeAll
Browse files Browse the repository at this point in the history
workaround for jestjs/jest#8688
  • Loading branch information
jharting committed Oct 8, 2019
1 parent 71b4240 commit 144e2af
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ import { createTestClient } from 'apollo-server-testing';
let ctx: any = null;

beforeAll(async () => {
const app = await start();
const { query } = createTestClient(app.apollo);
ctx = { app, query };
try {
const app = await start();
const { query } = createTestClient(app.apollo);
ctx = { app, query };
} catch (e) {
// workaround for https://github.com/facebook/jest/issues/8688
console.log(e);
throw e;
}
});

afterAll(async () => {
Expand Down

0 comments on commit 144e2af

Please sign in to comment.