2018-06-06 12:31:43 +00:00
|
|
|
import { exec } from 'child_process'
|
|
|
|
import { resolve } from 'path'
|
|
|
|
import { promisify } from 'util'
|
|
|
|
|
|
|
|
const execify = promisify(exec)
|
|
|
|
const rootDir = __dirname
|
|
|
|
const nuxtBin = resolve(__dirname, '..', '..', '..', 'bin', 'nuxt')
|
|
|
|
|
2018-07-20 16:23:46 +00:00
|
|
|
describe.skip.appveyor('cli build', () => {
|
2018-06-06 12:31:43 +00:00
|
|
|
test('nuxt build', async () => {
|
|
|
|
const { stdout } = await execify(`node ${nuxtBin} build ${rootDir} -c cli.build.config.js`)
|
|
|
|
|
|
|
|
expect(stdout.includes('Compiled successfully')).toBe(true)
|
|
|
|
}, 80000)
|
|
|
|
|
|
|
|
test('nuxt build -> error config', async () => {
|
|
|
|
await expect(execify(`node ${nuxtBin} build ${rootDir} -c config.js`)).rejects.toMatchObject({
|
|
|
|
stdout: expect.stringContaining('Could not load config file: config.js')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|