mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 14:41:25 +00:00
refactor: support string param in mock-log
This commit is contained in:
parent
68560c6aae
commit
0583558d77
@ -2,6 +2,8 @@
|
|||||||
export default function mockLog(levels = 'all', logger = console) {
|
export default function mockLog(levels = 'all', logger = console) {
|
||||||
if (levels === 'all') {
|
if (levels === 'all') {
|
||||||
levels = ['trace', 'debug', 'log', 'info', 'warn', 'error']
|
levels = ['trace', 'debug', 'log', 'info', 'warn', 'error']
|
||||||
|
} else if (typeof levels === 'string') {
|
||||||
|
levels = [levels]
|
||||||
}
|
}
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
for (let level of levels) {
|
for (let level of levels) {
|
||||||
|
Loading…
Reference in New Issue
Block a user