mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
28 lines
803 B
TypeScript
28 lines
803 B
TypeScript
import * as logger from './logger';
|
|
|
|
test('should require custom logger to implement info', () => {
|
|
const loggerImpl = {
|
|
debug: () => {},
|
|
warn: () => {},
|
|
error: () => {},
|
|
};
|
|
const provider = () => loggerImpl;
|
|
expect(() => {
|
|
// @ts-ignore:next-line
|
|
return logger.validateLogProvider(provider);
|
|
}).toThrowError(new TypeError('Logger must implement info'));
|
|
});
|
|
|
|
test('should require custom logger to implement error', () => {
|
|
const loggerImpl = {
|
|
debug: () => {},
|
|
warn: () => {},
|
|
info: () => {},
|
|
};
|
|
const provider = () => loggerImpl;
|
|
expect(() => {
|
|
// @ts-ignore:next-line
|
|
return logger.validateLogProvider(provider);
|
|
}).toThrowError(new TypeError('Logger must implement error'));
|
|
});
|