Skip to content

Commit

Permalink
fix(FEC-10779): add the all JSLogger for stubbing (#564)
Browse files Browse the repository at this point in the history
issue: missing methods and properties for getLogger
solution: add the stubbing for all the methods and properties
  • Loading branch information
Yuvalke committed Dec 27, 2020
1 parent 3ffa2dc commit afa194d
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions src/utils/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@
export type LogLevelObject = {value: number, name: string};
export type LogLevelType = {[level: string]: LogLevelObject};
export type loggerFunctionType = {
trace: Function,
VERSION: String,
DEBUG: LogLevelObject,
ERROR: LogLevelObject,
INFO: LogLevelObject,
OFF: LogLevelObject,
TIME: LogLevelObject,
TRACE: LogLevelObject,
WARN: LogLevelObject,
createDefaultHandler: Function,
debug: Function,
enabledFor: Function,
error: Function,
get: Function,
getLevel: Function,
info: Function,
log: Function,
warn: Function,
error: Function,
setHandler: Function,
setLevel: Function,
time: Function,
timeEnd: Function,
getLevel: Function,
setLevel: Function
trace: Function,
useDefaults: Function,
warn: Function
};

export type LoggerType = {
Expand All @@ -21,16 +34,29 @@ export type LoggerType = {

let JsLogger = {
get: () => ({
trace: () => {},
VERSION: '',
DEBUG: {value: '', name: ''},
ERROR: {value: '', name: ''},
INFO: {value: '', name: ''},
OFF: {value: '', name: ''},
TIME: {value: '', name: ''},
TRACE: {value: '', name: ''},
WARN: {value: '', name: ''},
createDefaultHandler: () => {},
debug: () => {},
enabledFor: () => {},
error: () => {},
get: () => {},
getLevel: () => {},
info: () => {},
log: () => {},
warn: () => {},
error: () => {},
setHandler: () => {},
setLevel: () => {},
time: () => {},
timeEnd: () => {},
getLevel: () => {},
setLevel: () => {}
trace: () => {},
useDefaults: () => {},
warn: () => {}
})
};

Expand Down

0 comments on commit afa194d

Please sign in to comment.