bitwane-test
A test output version of bitwane.
Install
npm install bitwane-test
Usage
import { TestLogger } from '../';
const logger = new TestLogger();
logger.diff({
one: 1,
two: 2,
thing: 'thing1',
sub: {
subone: 1,
subtwo: 2
}
}, {
one: 1,
three: 'three',
thing: 'thing2',
sub: {
subone: 1
}
});
logger.diff(`I am thing one`, `I am thing two`)
logger.diff(`I am a thing one`, `I am thing two`, 4)
logger.ok('This is ok', null, 8);
logger.notok('This is not ok');
logger.ok('The $(red)%(what)$() is red.', {what: 'moon'});
The constructor
The constructor takes the same options as bitwane with an extra option named maps
.
const logger = new TestLogger({
maps: {
ok(value){
return logSymbols.success + ' ' + value;
},
notok(value){
return logSymbols.error + ' ' + value;
},
diff(lvalue, rvalue, indent){
}
}
});
About
bitwane-test
inherits from bitwane. It is meant for formatting test output.