From e7703ef291a0277090c301d71ece156f4384018f Mon Sep 17 00:00:00 2001 From: Lursun Date: Thu, 15 Oct 2020 23:44:08 +0800 Subject: [PATCH] let consoleReporter support other reporters --- src/mochawesome.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mochawesome.js b/src/mochawesome.js index 18530be..61b3ad4 100755 --- a/src/mochawesome.js +++ b/src/mochawesome.js @@ -61,7 +61,11 @@ function consoleReporter(reporter) { try { return require(`mocha/lib/reporters/${reporter}`); } catch (e) { - log(`Unknown console reporter '${reporter}', defaulting to spec`); + try { + return require(reporter); + } catch (e) { + log(`Unknown console reporter '${reporter}', defaulting to spec`); + } } }