Created
December 3, 2018 15:57
-
-
Save jimmiehansson/0b01d2477f62b5a7068b160507ead4d0 to your computer and use it in GitHub Desktop.
example
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
// quick example | |
function expectedLogSuffix (expression = { str: '', encounters: 2 }) { | |
var { str, encounters } = expression | |
if (str === null || str.length === 0 || typeof str !== 'string') { | |
return undefined | |
} | |
var trim = str.split(' ').filter(n => n.match(/^[A-Z]{4}s*/)) | |
return trim.length === encounters | |
} | |
// expected format | |
var fmt = { | |
str: actual, | |
encounters: 2 | |
} | |
// make for cleaner unit abstraction | |
is(expectedLogSuffix(fmt), true) | |
isNot(actual.match('pino.final with prettyPrint does not support flushing'), null) | |
isNot(actual.match('beforeExit'), null) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment