2019-10-11 07:35:10 +00:00
|
|
|
import { NuxtCommand, commands } from '@nuxt/cli'
|
|
|
|
import consola from 'consola'
|
2018-06-06 12:31:43 +00:00
|
|
|
|
2018-10-25 11:33:07 +00:00
|
|
|
describe('cli generate', () => {
|
2019-10-11 07:35:10 +00:00
|
|
|
test('nuxt generate', async () => {
|
|
|
|
const generateCommand = await commands.default('generate')
|
|
|
|
|
|
|
|
const argv = [
|
|
|
|
__dirname,
|
|
|
|
'--no-force-exit',
|
|
|
|
'-c',
|
|
|
|
'cli.gen.config.js'
|
|
|
|
]
|
|
|
|
|
|
|
|
const cmd = new NuxtCommand(generateCommand, argv)
|
|
|
|
await expect(cmd.run()).resolves.toBeUndefined()
|
2018-06-06 12:31:43 +00:00
|
|
|
|
2019-10-11 07:35:10 +00:00
|
|
|
expect(consola.log).toBeCalledWith('Generated successfully')
|
|
|
|
})
|
2018-06-06 12:31:43 +00:00
|
|
|
})
|