From 144e2af677e4ade57eabcca1cce41d842c362d49 Mon Sep 17 00:00:00 2001 From: Jozef Hartinger Date: Mon, 7 Oct 2019 14:56:59 +0200 Subject: [PATCH] catch errors in beforeAll workaround for https://github.com/facebook/jest/issues/8688 --- test/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/index.ts b/test/index.ts index 1d230289..16074e04 100644 --- a/test/index.ts +++ b/test/index.ts @@ -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 () => {