update tests

master
pooya parsa 2019-03-24 16:29:15 +04:30
parent 15cca3aede
commit 33db91eed5
5 changed files with 10 additions and 17 deletions

View File

@ -1,11 +0,0 @@
module.exports = {
presets: [
[
'@babel/preset-env', {
targets: {
esmodules: true
}
}
]
]
}

View File

@ -13,10 +13,12 @@ async function setupNuxt(config) {
// Spy addTemplate // Spy addTemplate
nuxt.moduleContainer.addTemplate = jest.fn(nuxt.moduleContainer.addTemplate) nuxt.moduleContainer.addTemplate = jest.fn(nuxt.moduleContainer.addTemplate)
const build = new Builder(nuxt) const builder = new Builder(nuxt)
await build.validatePages() await builder.validatePages()
await build.generateRoutesAndFiles() await builder.generateRoutesAndFiles()
nuxt.builder = builder
await nuxt.listen(3000) await nuxt.listen(3000)

View File

@ -3,7 +3,7 @@ const { setupNuxt } = require('./_utils')
describe('browserBaseURL', () => { describe('browserBaseURL', () => {
let nuxt let nuxt
beforeAll(async () => { test('setup', async () => {
nuxt = await setupNuxt({ nuxt = await setupNuxt({
http: { http: {
browserBaseURL: '/test_api' browserBaseURL: '/test_api'

View File

@ -3,7 +3,7 @@ const { setupNuxt } = require('./_utils')
describe('empty config', () => { describe('empty config', () => {
let nuxt let nuxt
beforeAll(async () => { test('setup', async () => {
nuxt = await setupNuxt({ nuxt = await setupNuxt({
http: {} http: {}
}) })

View File

@ -6,8 +6,10 @@ const url = path => `http://localhost:3000${path}`
describe('module', () => { describe('module', () => {
let nuxt let nuxt
beforeAll(async () => { test('setup', async () => {
nuxt = await setupNuxt() nuxt = await setupNuxt()
await nuxt.builder.build()
}) })
afterAll(async () => { afterAll(async () => {