From 319cfeaa1c12e0b85f3bb39bffa86991c60a9442 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 12 Nov 2020 14:32:49 -0500 Subject: [PATCH] test: updated test name to be more specific --- test/api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/api.js b/test/api.js index 2b105d96d0..8f98c503bc 100644 --- a/test/api.js +++ b/test/api.js @@ -21,7 +21,7 @@ const flags = require('../src/flags'); const messaging = require('../src/messaging'); const utils = require('../src/utils'); -describe('Read API', async () => { +describe('API', async () => { let readApi = false; let writeApi = false; const readApiPath = path.resolve(__dirname, '../public/openapi/read.yaml'); @@ -32,6 +32,7 @@ describe('Read API', async () => { const unauthenticatedRoutes = ['/api/login', '/api/register']; // Everything else will be called with the admin user const mocks = { + head: {}, get: {}, post: {}, put: {}, @@ -200,7 +201,7 @@ describe('Read API', async () => { url = nconf.get('url') + (prefix || '') + testPath; }); - it('may contain a request body with application/json type if POST/PUT/DELETE', () => { + it('should contain a valid request body (if present) with application/json type if POST/PUT/DELETE', () => { if (['post', 'put', 'delete'].includes(method) && context[method].hasOwnProperty('requestBody')) { assert(context[method].requestBody); assert(context[method].requestBody.content);