mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 17:32:31 +00:00
17 lines
346 B
TypeScript
17 lines
346 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
|
|
}
|