X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Flib%2Fcommon.js;h=6140d874bd9ef41a9591c28194ae772f21c1e3d9;hb=97be4c0841f2615651c6cd6fb466aada47773cc4;hp=a04bf614eeadac136f2df8ff44cf1519846d8221;hpb=c980310d2de988d5f4e3c932eb77ebe83daa27b9;p=squeep-api-dingus diff --git a/test/lib/common.js b/test/lib/common.js index a04bf61..6140d87 100644 --- a/test/lib/common.js +++ b/test/lib/common.js @@ -9,19 +9,6 @@ const common = require('../../lib/common'); describe('common', function () { - describe('fileScope', function () { - it('names a file path', function () { - const filename = 'lib/foo/bar.js'; - const result = common.fileScope(filename)('baz'); - assert.strictEqual(result, 'bar:baz'); - }); - it('names an index path', function () { - const filename = 'lib/foo/index.js'; - const result = common.fileScope(filename)('baz'); - assert.strictEqual(result, 'foo:baz'); - }); - }); // fileScope - describe('generateETag', function () { it('generates a tag from data', function () { const expected = '"RHUvNyculE/SyROjU0LqzN0arxibrlBnazAashP8UGE"'; @@ -128,34 +115,6 @@ describe('common', function () { }); }); // pick - describe('requestLogData', function () { - it('gives data', function () { - const req = { - method: 'GET', - somethingElse: 'blah', - }; - const result = common.requestLogData(req); - assert.deepStrictEqual(result, { - method: 'GET', - }); - }); - }); // requestLogData - - describe('responseLogData', function () { - it('gives data', function () { - const res = { - getHeaders: () => ({}), - statusCode: 200, - blah: 'blah', - }; - const result = common.responseLogData(res); - assert.deepStrictEqual(result, { - headers: {}, - statusCode: 200, - }); - }); - }); // responseLogData - describe('setOptions', function () { it('sets options', function () { const expected = { @@ -258,13 +217,6 @@ describe('common', function () { }); }); // requestId - describe('ensureLoggerLevels', function () { - it('adds missing levels', function () { - const result = common.ensureLoggerLevels(); - assert.deepStrictEqual(result, common.nullLogger); - }); - }); // ensureLoggerLevels - describe('httpStatusCodeClass', function () { it('works', function () { for (const [statusCode, statusClassExpected] of Object.entries({