triple-beam
Advanced tools
Comparing version 1.2.0 to 1.3.0
# CHANGELOG | ||
### 1.3.0 | ||
- [#4] Add `SPLAT` symbol. | ||
- [#3] Add linting & TravisCI. | ||
### 1.2.0 | ||
@@ -4,0 +9,0 @@ |
13
index.js
@@ -28,2 +28,13 @@ 'use strict'; | ||
/** | ||
* A shareable symbol constant that can be used | ||
* as a non-enumerable / semi-hidden message identifier | ||
* to allow the extracted splat property be hidden | ||
* | ||
* @type {Symbol} | ||
*/ | ||
Object.defineProperty(exports, 'SPLAT', { | ||
value: Symbol.for('splat') | ||
}); | ||
/** | ||
* A shareable object constant that can be used | ||
@@ -36,2 +47,2 @@ * as a standard configuration for winston@3. | ||
value: require('./config') | ||
}) | ||
}); |
{ | ||
"name": "triple-beam", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Definitions of levels for logging purposes & shareable Symbol constants.", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "populist config/*.js index.js", | ||
"pretest": "npm run lint", | ||
"test": "nyc mocha test.js" | ||
@@ -29,6 +31,7 @@ }, | ||
"devDependencies": { | ||
"assume": "^2.0.0", | ||
"mocha": "^3.5.3", | ||
"nyc": "^11.2.1" | ||
"assume": "^2.0.1", | ||
"eslint-config-populist": "^4.1.0", | ||
"mocha": "^5.1.1", | ||
"nyc": "^11.7.1" | ||
} | ||
} |
25
test.js
@@ -51,2 +51,25 @@ const assume = require('assume'); | ||
describe('SPLAT constant', function () { | ||
it('is exposed', function () { | ||
assume(tripleBeam.SPLAT); | ||
}); | ||
it('is a Symbol', function () { | ||
assume(tripleBeam.SPLAT).is.a('symbol'); | ||
}); | ||
it('is not mutable', function () { | ||
// | ||
// Assert that the symbol does not change | ||
// even though the operation does not throw. | ||
// | ||
const OVERWRITE = Symbol('overwrite'); | ||
const SPLAT = tripleBeam.SPLAT; | ||
assume(SPLAT).not.equals(OVERWRITE); | ||
tripleBeam.SPLAT = OVERWRITE; | ||
assume(tripleBeam.SPLAT).equals(SPLAT); | ||
}); | ||
}); | ||
describe('configs constant', function () { | ||
@@ -75,3 +98,3 @@ it('is exposed', function () { | ||
}); | ||
}) | ||
}); | ||
}); |
9211
13
259
4