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 build', () => {
|
2019-10-11 07:35:10 +00:00
|
|
|
test('nuxt build', async () => {
|
|
|
|
const buildCommand = await commands.default('build')
|
|
|
|
|
|
|
|
const argv = [
|
|
|
|
__dirname,
|
|
|
|
'--no-force-exit',
|
|
|
|
'-c',
|
|
|
|
'cli.build.config.js'
|
|
|
|
]
|
2018-06-06 12:31:43 +00:00
|
|
|
|
2019-10-11 07:35:10 +00:00
|
|
|
const cmd = new NuxtCommand(buildCommand, 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('Compiled successfully')
|
2018-06-06 12:31:43 +00:00
|
|
|
})
|
|
|
|
})
|