mirror of https://github.com/sundowndev/http.git
update tests
parent
15cca3aede
commit
33db91eed5
|
@ -1,11 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'@babel/preset-env', {
|
|
||||||
targets: {
|
|
||||||
esmodules: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -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: {}
|
||||||
})
|
})
|
||||||
|
|
|
@ -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 () => {
|
||||||
|
|
Loading…
Reference in New Issue