mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
1dd32d0d21
* add ~> addReporter * remove badge * withScope ~> withTag * update to consola 2 * update build tests
22 lines
730 B
JavaScript
22 lines
730 B
JavaScript
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')
|
|
|
|
describe('cli build', () => {
|
|
test('nuxt build', async () => {
|
|
const { stdout } = await execify(`node -r esm ${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({
|
|
stderr: expect.stringContaining('Could not load config file: config.js')
|
|
})
|
|
})
|
|
})
|