From 2f56d2b5caf9ece0c2493352855155e5ddfe870d Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 22 Nov 2018 18:52:47 +0200 Subject: [PATCH] test(route) realpath: error --- server/route.spec.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/route.spec.js b/server/route.spec.js index 17653d72..3856f37c 100644 --- a/server/route.spec.js +++ b/server/route.spec.js @@ -18,13 +18,13 @@ const terminalPath = './terminal'; const cloudcmd = require(cloudcmdPath); const serveOnce = require('serve-once'); -const config = { +const defaultConfig = { auth: false, dropbox: false, }; const {request} = serveOnce(cloudcmd, { - config, + config: defaultConfig, }); test('cloudcmd: route: buttons: no console', async (t) => { @@ -217,8 +217,6 @@ test('cloudcmd: route: symlink', async (t) => { fs.unlinkSync(symlink); - console.log(body); - t.ok(body.length, 'should return html document'); t.end(); }); @@ -261,12 +259,15 @@ test('cloudcmd: route: realpath: error', async (t) => { reRequire(routePath); const cloudcmd = reRequire(cloudcmdPath); - const {request} = serveOnce(cloudcmd); + const {request} = serveOnce(cloudcmd, { + config: defaultConfig + }); const {body} = await request.get('/fs/empty-file', { options, }); fs.realpath = realpath; + console.log(body); t.ok(/^ENOENT/.test(body), 'should return error'); t.end();