Skip to content

Commit

Permalink
0.0.6 - update o-validator and related specs
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCannon committed Feb 14, 2018
1 parent f855989 commit 4755868
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 53 deletions.
4 changes: 2 additions & 2 deletions package.json
@@ -1,11 +1,11 @@
{
"name" : "alien-node-winston-utils",
"version" : "0.0.5",
"version" : "0.0.6",
"description" : "Helper functions for Winston logging on NodeJS",
"main" : "lib/Logger.js",
"dependencies" : {
"ramda" : "^0.x.x",
"o-validator" : "^0.1.x"
"o-validator" : "^1.x.x"
},
"devDependencies" : {
"coveralls" : "^2.11.2",
Expand Down
8 changes: 2 additions & 6 deletions spec/concatLogPiecesSpec.js
Expand Up @@ -4,13 +4,9 @@ const concatLogPieces = require('../lib/methods/concatLogPieces');

const FAKE_LOG_PIECES = [1, 2, 3];

const makeIllegalParamError = (param) => {
return new Error('Illegal value for parameter: ' + param);
};
const makeIllegalParamError = param => new Error(`Validation Error: Illegal value for parameter "${param}"`);

const makeMissingParamError = (param) => {
return new Error('Missing required parameter: ' + param);
};
const makeMissingParamError = param => new Error(`Validation Error: Missing required parameter "${param}"`);

describe('concatLogPieces', () => {
it('converts an array into a space-delimited string when given no delimiter', () => {
Expand Down
62 changes: 27 additions & 35 deletions spec/getFormatterSpec.js
Expand Up @@ -31,41 +31,33 @@ const fakeOptionsWithMeta = R.merge(fakeOptionsMinimal, {

const fakeOptionsWithMessageAndMeta = R.merge(fakeOptionsWithMessage, fakeOptionsWithMeta);

const makeFakeExpectedMinimalLog = () => {
return concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_EMPTY_MESSAGE,
FAKE_STRINGIFIED_EMPTY_META
]);
};

const makeFakeExpectedLogWithMessage = () => {
return concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_MESSAGE,
FAKE_STRINGIFIED_EMPTY_META
]);
};

const makeFakeExpectedLogWithMeta = () => {
return concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_EMPTY_MESSAGE,
FAKE_STRINGIFIED_META
]);
};

const makeFakeExpectedLogWithMessageAndMeta = () => {
return concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_MESSAGE,
FAKE_STRINGIFIED_META
]);
};
const makeFakeExpectedMinimalLog = () => concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_EMPTY_MESSAGE,
FAKE_STRINGIFIED_EMPTY_META
]);

const makeFakeExpectedLogWithMessage = () => concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_MESSAGE,
FAKE_STRINGIFIED_EMPTY_META
]);

const makeFakeExpectedLogWithMeta = () => concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_EMPTY_MESSAGE,
FAKE_STRINGIFIED_META
]);

const makeFakeExpectedLogWithMessageAndMeta = () => concatLogPieces([
Date(),
FAKE_LOG_LEVEL,
FAKE_MESSAGE,
FAKE_STRINGIFIED_META
]);

describe('getFormatter', () => {

Expand Down
4 changes: 1 addition & 3 deletions spec/getTimestampSpec.js
Expand Up @@ -5,9 +5,7 @@ const getTimestamp = require('../lib/methods/getTimestamp.js');
const FAKE_TIMESTAMP = 'foo';

const mockOptions = {
timestamp : () => {
return FAKE_TIMESTAMP;
}
timestamp : () => FAKE_TIMESTAMP
};

describe('getTimestamp', () => {
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Expand Up @@ -537,11 +537,11 @@ nopt@3.x:
dependencies:
abbrev "1"

o-validator@^0.1.x:
version "0.1.6"
resolved "https://registry.yarnpkg.com/o-validator/-/o-validator-0.1.6.tgz#9b5b48a0888e2f6af5b2597519bfe048c5ae1382"
o-validator@^1.x.x:
version "1.0.1"
resolved "https://registry.yarnpkg.com/o-validator/-/o-validator-1.0.1.tgz#a0cfe12f1a1575701bb6909f4a24bc4c92d4ced2"
dependencies:
ramda "^0.13.0"
ramda "0.17.1"

oauth-sign@~0.8.1:
version "0.8.2"
Expand Down Expand Up @@ -597,9 +597,9 @@ qs@~6.3.0:
version "6.3.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c"

ramda@^0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.13.0.tgz#2fdca73238677c82fd75afa9191b1a747343a36c"
ramda@0.17.1:
version "0.17.1"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.17.1.tgz#4c198147d3ab54e8c15255f11730e2116f6e6073"

ramda@^0.x.x:
version "0.25.0"
Expand Down

0 comments on commit 4755868

Please sign in to comment.