mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
17 lines
342 B
TypeScript
17 lines
342 B
TypeScript
|
import consola from 'consola'
|
||
|
import { useTestContext } from './context'
|
||
|
|
||
|
export function mockFn () {
|
||
|
const ctx = useTestContext()
|
||
|
return ctx.mockFn
|
||
|
}
|
||
|
|
||
|
export function mockLogger (): Record<string, Function> {
|
||
|
const mocks: any = {}
|
||
|
consola.mockTypes((type) => {
|
||
|
mocks[type] = mockFn()
|
||
|
return mocks[type]
|
||
|
})
|
||
|
return mocks
|
||
|
}
|