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
nuxt.moduleContainer.addTemplate = jest.fn(nuxt.moduleContainer.addTemplate)
const build = new Builder(nuxt)
const builder = new Builder(nuxt)
await build.validatePages()
await build.generateRoutesAndFiles()
await builder.validatePages()
await builder.generateRoutesAndFiles()
nuxt.builder = builder
await nuxt.listen(3000)

View File

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

View File

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

View File

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