From 1fa319ac9fa3c01fe11a4a497e548779ea6e0ed3 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 24 Jan 2024 14:11:24 +0000 Subject: [PATCH] Add throw functionality to get more information about errors occurring during tests. --- packages/server/src/tests/utilities/TestConfiguration.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/tests/utilities/TestConfiguration.ts b/packages/server/src/tests/utilities/TestConfiguration.ts index b5810b9ba3..4785994da4 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.ts +++ b/packages/server/src/tests/utilities/TestConfiguration.ts @@ -278,6 +278,9 @@ class TestConfiguration { if (params) { request.params = params } + request.throw = (status: number, message: string) => { + throw new Error(`Error ${status} - ${message}`) + } return this.doInContext(appId, async () => { await controlFunc(request) return request.body