2020-04-13 14:34:26 +02:00
|
|
|
import * as factory from '../src';
|
|
|
|
|
|
|
|
describe('prettyFactory', () => {
|
2020-08-13 23:27:00 +02:00
|
|
|
const prettyfierOptions = { messageKey: 'msg', levelFirst: true, prettyStamp: false };
|
|
|
|
test('should return a function', () => {
|
|
|
|
expect(typeof factory['default']({})).toEqual('function');
|
|
|
|
});
|
2020-04-13 14:34:26 +02:00
|
|
|
|
2020-08-13 23:27:00 +02:00
|
|
|
test('should return a function', () => {
|
|
|
|
const log = {
|
|
|
|
level: 10,
|
|
|
|
foo: 'foo',
|
|
|
|
msg: '[trace] - @{foo}',
|
|
|
|
};
|
2020-04-13 14:34:26 +02:00
|
|
|
|
2020-08-13 23:27:00 +02:00
|
|
|
expect(factory['default'](prettyfierOptions)(log)).toMatchSnapshot();
|
|
|
|
});
|
2020-04-13 14:34:26 +02:00
|
|
|
});
|