Nuxt/test/fixtures/cli/cli.build.test.js

22 lines
737 B
JavaScript
Raw Normal View History

import { exec } from 'child_process'
import { resolve } from 'path'
import { promisify } from 'util'
const execify = promisify(exec)
const rootDir = __dirname
const nuxtBin = resolve(__dirname, '../../../packages/cli/bin/nuxt.js')
2018-10-23 09:55:08 +00:00
describe.skip.appveyor('cli build', () => {
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 -r esm ${nuxtBin} build ${rootDir} -c config.js`)).rejects.toMatchObject({
stdout: expect.stringContaining('Could not load config file: config.js')
})
})
})