From 5c69e0e288c68914d5a4bd88bd9eae523fba7e78 Mon Sep 17 00:00:00 2001 From: Gomah Date: Fri, 17 Nov 2017 11:27:30 +1100 Subject: [PATCH] tests: make sure the files generated with the subFolders option exist --- test/basic.generate.nosubfolders.test.js | 3 +++ test/basic.generate.test.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/basic.generate.nosubfolders.test.js b/test/basic.generate.nosubfolders.test.js index 5fde5d65b9..ce9c1d813a 100644 --- a/test/basic.generate.nosubfolders.test.js +++ b/test/basic.generate.nosubfolders.test.js @@ -1,5 +1,6 @@ import test from 'ava' import { resolve } from 'path' +import { existsSync } from 'fs' import http from 'http' import serveStatic from 'serve-static' import finalhandler from 'finalhandler' @@ -78,6 +79,8 @@ test('/async-data', async t => { test('/users/1', async t => { const html = await rp(url('/users/1')) t.true(html.includes('

User: 1

')) + 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 => { diff --git a/test/basic.generate.test.js b/test/basic.generate.test.js index dc0eb55caf..0e1020847e 100644 --- a/test/basic.generate.test.js +++ b/test/basic.generate.test.js @@ -1,5 +1,6 @@ import test from 'ava' import { resolve } from 'path' +import { existsSync } from 'fs' import http from 'http' import serveStatic from 'serve-static' import finalhandler from 'finalhandler' @@ -75,6 +76,8 @@ test('/async-data', async t => { test('/users/1', async t => { const html = await rp(url('/users/1')) t.true(html.includes('

User: 1

')) + 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 => {