Nuxt/packages/cli/test/unit/hooks.test.js

24 lines
453 B
JavaScript
Raw Normal View History

2019-08-24 14:15:08 +00:00
import { NuxtCommand } from '../utils'
describe('dev', () => {
let dev
beforeAll(async () => {
dev = await import('../../src/commands/dev').then(m => m.default)
})
afterEach(() => jest.clearAllMocks())
test('config hook', async () => {
const hooks = {
config: jest.fn()
}
await NuxtCommand.run(dev, [], hooks)
expect(hooks.config).toHaveBeenCalledWith(expect.objectContaining({
_cli: true
}))
})
})