mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
test(route) realpath: error
This commit is contained in:
parent
e6195302e2
commit
2f56d2b5ca
1 changed files with 6 additions and 5 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue