mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
tests: make sure the files generated with the subFolders option exist
This commit is contained in:
parent
682169625f
commit
5c69e0e288
@ -1,5 +1,6 @@
|
|||||||
import test from 'ava'
|
import test from 'ava'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
|
import { existsSync } from 'fs'
|
||||||
import http from 'http'
|
import http from 'http'
|
||||||
import serveStatic from 'serve-static'
|
import serveStatic from 'serve-static'
|
||||||
import finalhandler from 'finalhandler'
|
import finalhandler from 'finalhandler'
|
||||||
@ -78,6 +79,8 @@ test('/async-data', async t => {
|
|||||||
test('/users/1', async t => {
|
test('/users/1', async t => {
|
||||||
const html = await rp(url('/users/1'))
|
const html = await rp(url('/users/1'))
|
||||||
t.true(html.includes('<h1>User: 1</h1>'))
|
t.true(html.includes('<h1>User: 1</h1>'))
|
||||||
|
t.true(existsSync(resolve(__dirname, 'fixtures/basic/dist', 'users/1.html')))
|
||||||
|
t.false(existsSync(resolve(__dirname, 'fixtures/basic/dist', 'users/1/index.html')))
|
||||||
})
|
})
|
||||||
|
|
||||||
test('/users/2', async t => {
|
test('/users/2', async t => {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import test from 'ava'
|
import test from 'ava'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
|
import { existsSync } from 'fs'
|
||||||
import http from 'http'
|
import http from 'http'
|
||||||
import serveStatic from 'serve-static'
|
import serveStatic from 'serve-static'
|
||||||
import finalhandler from 'finalhandler'
|
import finalhandler from 'finalhandler'
|
||||||
@ -75,6 +76,8 @@ test('/async-data', async t => {
|
|||||||
test('/users/1', async t => {
|
test('/users/1', async t => {
|
||||||
const html = await rp(url('/users/1'))
|
const html = await rp(url('/users/1'))
|
||||||
t.true(html.includes('<h1>User: 1</h1>'))
|
t.true(html.includes('<h1>User: 1</h1>'))
|
||||||
|
t.true(existsSync(resolve(__dirname, 'fixtures/basic/dist', 'users/1/index.html')))
|
||||||
|
t.false(existsSync(resolve(__dirname, 'fixtures/basic/dist', 'users/1.html')))
|
||||||
})
|
})
|
||||||
|
|
||||||
test('/users/2', async t => {
|
test('/users/2', async t => {
|
||||||
|
Loading…
Reference in New Issue
Block a user