Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
hiro5id committed Dec 16, 2019
1 parent 2557f9c commit 6728ba9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,21 @@ describe('logger', () => {
expect(testObj.obj).eql({ subObj1:"subObj1", subObj2:"subObj2"});
});

it('concatenates string and numbers', async () => {
const {originalWrite, outputText} = overrideStdOut();
LoggerAdaptToConsole();

console.log('string merged', 400);

restoreStdOut(originalWrite);
LoggerRestoreConsole();

console.log(outputText[0]);
const testObj = JSON.parse(outputText[0]);
expect(testObj.level).eql("info");
expect(testObj.message).eql("string merged - 400");
});

// Todo: test multiple nested ErrorWithContext objects to ensure proper stacktrace and error messages
});

Expand Down

0 comments on commit 6728ba9

Please sign in to comment.