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
|
2018-10-17 21:28:25 +00:00
|
|
|
const nuxtBin = resolve(__dirname, '../../../packages/cli/bin/nuxt.js')
|
2018-06-06 12:31:43 +00:00
|
|
|
|
2018-10-25 11:33:07 +00:00
|
|
|
describe('cli build', () => {
|
2018-11-08 09:15:56 +00:00
|
|
|
test.skip('nuxt build', async () => {
|
2018-10-30 20:42:53 +00:00
|
|
|
const { stdout } = await execify(`node -r esm ${nuxtBin} build ${rootDir} -c cli.build.config.js`)
|
2018-06-06 12:31:43 +00:00
|
|
|
|
|
|
|
expect(stdout.includes('Compiled successfully')).toBe(true)
|
|
|
|
}, 80000)
|
|
|
|
|
2018-11-08 09:15:56 +00:00
|
|
|
test.skip('nuxt build -> error config', async () => {
|
2018-10-17 21:28:25 +00:00
|
|
|
await expect(execify(`node -r esm ${nuxtBin} build ${rootDir} -c config.js`)).rejects.toMatchObject({
|
2018-11-01 03:50:07 +00:00
|
|
|
stderr: expect.stringContaining('Could not load config file: config.js')
|
2018-06-06 12:31:43 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|