test:build in test env

This commit is contained in:
Clark Du 2018-08-10 16:39:49 +01:00
parent b0ddccb3de
commit c8ced350b8
3 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ let page = null
// Init nuxt.js and create server listening on localhost:4003
test.serial('Init Nuxt.js', async (t) => {
const options = {
test: true,
rootDir: resolve(__dirname, 'fixtures/basic'),
buildDir: '.nuxt-csr',
dev: true,

View File

@ -9,6 +9,7 @@ let transpile = null
describe('basic dev', () => {
beforeAll(async () => {
const config = loadFixture('basic', {
test: true,
dev: true,
debug: true,
buildDir: '.nuxt-dev',

View File

@ -7,7 +7,7 @@ describe('nuxt', () => {
})
test('Nuxt.js Instance', async () => {
const config = loadFixture('empty')
const config = loadFixture('empty', { test: true })
const nuxt = new Nuxt(config)
expect(typeof nuxt).toBe('object')
@ -33,7 +33,7 @@ describe('nuxt', () => {
})
test('Build with default page when no pages/ directory', async () => {
const nuxt = new Nuxt()
const nuxt = new Nuxt({ test: true })
new Builder(nuxt).build()
const port = await getPort()
await nuxt.listen(port, 'localhost')
@ -46,6 +46,7 @@ describe('nuxt', () => {
test('Fail to build when specified plugin isn\'t found', () => {
const nuxt = new Nuxt({
test: true,
dev: false,
rootDir: resolve(__dirname, '..', 'fixtures', 'missing-plugin')
})