diff --git a/test/functional/request/createLanguidReq.js b/test/functional/request/createLanguidReq.js index 66f8309..0357f3d 100644 --- a/test/functional/request/createLanguidReq.js +++ b/test/functional/request/createLanguidReq.js @@ -32,7 +32,7 @@ test('createLanguidReq', t => { const languidReq = createLanguidReq(httpReqMock) - const expectLanguidReq = { + const expectedLanguidReq = { body: { content: 'stuff', }, @@ -46,5 +46,5 @@ test('createLanguidReq', t => { url: '/bla?name=john', } - t.deepEqual(languidReq, expectLanguidReq, 'wrong content') + t.deepEqual(languidReq, expectedLanguidReq, 'wrong content') }) diff --git a/test/integration/v1.0.3.js b/test/integration/v1.0.3.js index 00424a0..d2115e7 100644 --- a/test/integration/v1.0.3.js +++ b/test/integration/v1.0.3.js @@ -9,11 +9,11 @@ test('v1.0.3', t => { resolveWithFullResponse: true, } - const expectHeaders = { + const expectedHeaders = { stuff: 'content', } - const expectBody = JSON.stringify({ + const expectedBody = JSON.stringify({ ok: 'ok' }) @@ -23,7 +23,7 @@ test('v1.0.3', t => { t.is(res.headers['content-type'], 'application/json', 'wrong headers') t.is(res.headers['x-powered-by'], 'languid', 'wrong headers') t.is(res.headers.stuff, 'content', 'wrong headers') - t.is(res.body, expectBody, 'wrong body') + t.is(res.body, expectedBody, 'wrong body') }) .catch(t.fail) }) @@ -39,9 +39,9 @@ test('v1.0.3', t => { json: true, } - const expectHeaders = {} + const expectedHeaders = {} - const expectBody = { + const expectedBody = { message: 'Internal Server Error', } @@ -51,7 +51,7 @@ test('v1.0.3', t => { t.is(res.statusCode, 500, 'wrong statusCode') t.is(res.headers['content-type'], 'application/json', 'wrong headers') t.is(res.headers['x-powered-by'], 'languid', 'wrong headers') - t.deepEqual(res.body, expectBody, 'wrong body') + t.deepEqual(res.body, expectedBody, 'wrong body') }) }) @@ -66,9 +66,9 @@ test('v1.0.3', t => { json: true, } - const expectHeaders = {} + const expectedHeaders = {} - const expectBody = { + const expectedBody = { got: 'bla' } @@ -78,6 +78,6 @@ test('v1.0.3', t => { t.is(res.statusCode, 404, 'wrong statusCode') t.is(res.headers['content-type'], 'application/json', 'wrong headers') t.is(res.headers['x-powered-by'], 'languid', 'wrong headers') - t.deepEqual(res.body, expectBody, 'wrong body') + t.deepEqual(res.body, expectedBody, 'wrong body') }) }) diff --git a/test/unit/response/responseBuilder.js b/test/unit/response/responseBuilder.js index 50fce6a..0742e96 100644 --- a/test/unit/response/responseBuilder.js +++ b/test/unit/response/responseBuilder.js @@ -14,7 +14,7 @@ test('responseBuilder', t => { const response = responseBuilder(languidResMock) - const expectResponse = { + const expectedResponse = { statusCode: 500, headers: { a: 'header', @@ -26,7 +26,7 @@ test('responseBuilder', t => { }), } - t.deepEqual(response, expectResponse, 'wrong content') + t.deepEqual(response, expectedResponse, 'wrong content') }) test('responseBuilder', t => { @@ -34,7 +34,7 @@ test('responseBuilder', t => { const response = responseBuilder(languidResMock) - const expectResponse = { + const expectedResponse = { statusCode: undefined, headers: { 'Content-Type': 'application/json', @@ -43,5 +43,5 @@ test('responseBuilder', t => { body: JSON.stringify({}), } - t.deepEqual(response, expectResponse, 'wrong content') + t.deepEqual(response, expectedResponse, 'wrong content') }) diff --git a/test/unit/routes_handlers/executeHandler.js b/test/unit/routes_handlers/executeHandler.js index d1e6e06..366f671 100644 --- a/test/unit/routes_handlers/executeHandler.js +++ b/test/unit/routes_handlers/executeHandler.js @@ -52,7 +52,7 @@ test('executeHandler', t => { const response = executeHandler(languidReqMock)(route.handler) - const expectResponse = { + const expectedResponse = { statusCode: 204, body: { stuff: 'content', @@ -60,5 +60,5 @@ test('executeHandler', t => { } t.is(handlerCalls, 1, 'wrong number of `handler` calls') - t.deepEqual(response, expectResponse, 'wrong response content') + t.deepEqual(response, expectedResponse, 'wrong response content') }) diff --git a/test/unit/utils/bufferArrayToObject.js b/test/unit/utils/bufferArrayToObject.js index 372b088..f8301a8 100644 --- a/test/unit/utils/bufferArrayToObject.js +++ b/test/unit/utils/bufferArrayToObject.js @@ -29,3 +29,19 @@ test('bufferArrayToObject', t => { 'wrong content' ) }) + +test('bufferArrayToObject', t => { + const dataString = '' + + const bufferArray = [Buffer(dataString)] + + t.is(typeof bufferArrayToObject(bufferArray), 'object', 'wrong type') + + const expectedObject = {} + + t.deepEqual( + bufferArrayToObject(bufferArray), + expectedObject, + 'wrong content' + ) +})