pass cli tests

This commit is contained in:
Pooya Parsa 2018-03-12 03:07:38 +03:30
parent 9fe564b8f2
commit 16821361a0
2 changed files with 3 additions and 8 deletions

View File

@ -69,7 +69,7 @@ if (options.mode !== 'spa') {
// -- Build for SSR app --
builder
.build()
.then(() => debug('Building done'))
.then(() => console.error('Building done'))
.then(() => close())
.catch(Utils.fatalError)
} else {

View File

@ -1,6 +1,6 @@
import { promisify } from 'util'
import test from 'ava'
import { resolve, sep } from 'path'
import { resolve } from 'path'
import rp from 'request-promise-native'
import { exec, spawn } from 'child_process'
import { Utils } from '..'
@ -91,12 +91,7 @@ test.serial('nuxt start', async t => {
})
test.serial('nuxt generate', async t => {
const { stdout, stderr } = await execify(`node ${nuxtBin} generate ${rootDir}`)
const { stdout } = await execify(`node ${nuxtBin} generate ${rootDir}`)
t.true(stdout.includes('server-bundle.json'))
t.true(stderr.includes('Destination folder cleaned'))
t.true(stderr.includes('Static & build files copied'))
t.true(stderr.includes(`Generate file: ${sep}users${sep}1${sep}index.html`))
t.true(stdout.includes('Generate errors summary:'))
t.true(stderr.includes('Generate done'))
})