Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Date instances logging support; fix for #105
- Loading branch information
1 parent
bb85d52
commit 5cb0d75
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @module 'helpers-test' | ||
* @fileoverview Tests for winston-mongodb internal helpers methods | ||
* @license MIT | ||
* @author 0@39.yt (Yurij Mikhalevich) | ||
*/ | ||
'use strict'; | ||
const vows = require('vows'); | ||
const assert = require('assert'); | ||
const helpers = require('../lib/helpers'); | ||
|
||
const originalData = {customDate: new Date()}; | ||
|
||
vows.describe('winston-mongodb-helpers').addBatch({ | ||
'prepareMetaData': { | ||
topic: helpers.prepareMetaData(originalData), | ||
'should preserve Date instances': function(preparedData) { | ||
assert.isTrue(preparedData.customDate instanceof Date); | ||
assert.equal(+preparedData.customDate, +originalData.customDate); | ||
} | ||
} | ||
}).export(module); |