Nuxt/packages/cli/test/unit/hooks.test.js
2019-08-24 18:45:08 +04:30

24 lines
453 B
JavaScript

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
}))
})
})