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