Skip to content

Commit

Permalink
fix: test printer captures all arguments passed to log, debug, etc...…
Browse files Browse the repository at this point in the history
… (not just the first one)
  • Loading branch information
mike-north committed Aug 2, 2018
1 parent 812d3bb commit 5cb8600
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import { Printer } from 'bite-log';
export function makeTestPrinter(): Printer & { messages: any } {
const printer = {
messages: {
log: [] as string[],
debug: [] as string[],
warn: [] as string[],
error: [] as string[]
log: [] as any[][],
debug: [] as any[][],
warn: [] as any[][],
error: [] as any[][]
},
log(msg: string) {
printer.messages.log.push(msg);
log(_msg: string) {
printer.messages.log.push([...arguments]);
},
debug(msg: string) {
printer.messages.debug.push(msg);
debug(_msg: string) {
printer.messages.debug.push([...arguments]);
},
warn(msg: string) {
printer.messages.warn.push(msg);
warn(_msg: string) {
printer.messages.warn.push([...arguments]);
},
error(msg: string) {
printer.messages.error.push(msg);
error(_msg: string) {
printer.messages.error.push([...arguments]);
}
};
return printer;
Expand Down

0 comments on commit 5cb8600

Please sign in to comment.