From 0583558d77ca98f7fb889e9261c0eccd1d58ac92 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Wed, 18 Apr 2018 23:11:06 +0800 Subject: [PATCH] refactor: support string param in mock-log --- test/utils/mock-log.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/utils/mock-log.js b/test/utils/mock-log.js index c220c52925..ffed3743c4 100644 --- a/test/utils/mock-log.js +++ b/test/utils/mock-log.js @@ -2,6 +2,8 @@ export default function mockLog(levels = 'all', logger = console) { if (levels === 'all') { levels = ['trace', 'debug', 'log', 'info', 'warn', 'error'] + } else if (typeof levels === 'string') { + levels = [levels] } beforeAll(() => { for (let level of levels) {