From 85a67b533ab3a05303b2445266a1eb8710fcff72 Mon Sep 17 00:00:00 2001 From: antelle Date: Thu, 26 Nov 2020 22:27:20 +0100 Subject: [PATCH] fixed test runner fatal error reporting --- test/index.js | 12 +++++++++++- test/runner.html | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test/index.js b/test/index.js index 29da6f70..c3f3c8e8 100644 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,14 @@ function requireAll(req) { - req.keys().forEach(req); + req.keys().forEach((mod) => { + try { + req(mod); + } catch (ex) { + // eslint-disable-next-line no-console + console.error('Error while running test', mod, ex.toString()); + if ('testErrors' in global) { + global.testErrors++; + } + } + }); } requireAll(require.context('test/src/', true, /\.js$/)); diff --git a/test/runner.html b/test/runner.html index 4977c9b3..ba6cea9c 100644 --- a/test/runner.html +++ b/test/runner.html @@ -23,11 +23,15 @@