diff --git a/test/rest/config.js b/test/rest/config.js index e33a23a5..0d161e64 100644 --- a/test/rest/config.js +++ b/test/rest/config.js @@ -19,10 +19,11 @@ const manageConfig = require('../../server/config'); const pathConfig = path.join(os.homedir(), '.cloudcmd.json'); test('cloudcmd: rest: config: get', async (t) => { - const {body} = await request.get('/api/v1/config'); - const config = JSON.parse(body); + const {body} = await request.get('/api/v1/config', { + type: 'json' + }); - t.notOk(config.auth, 'should config.auth to be false'); + t.notOk(body.auth, 'should config.auth to be false'); t.end(); }); diff --git a/test/rest/fs.js b/test/rest/fs.js index 9247ea4f..c8010c49 100644 --- a/test/rest/fs.js +++ b/test/rest/fs.js @@ -7,8 +7,11 @@ const cloudcmd = require('../..'); const {request} = require('serve-once')(cloudcmd); test('cloudcmd: rest: fs: path', async (t) => { - const {body} = await request.get(`/api/v1/fs`); - const {path} = JSON.parse(body); + const {body} = await request.get(`/api/v1/fs`, { + type: 'json' + }); + + const {path} = body; t.equal('/', path, 'should dir path be "/"'); t.end();