Skip to content

Commit 20d7ca3

Browse files
committed
fix: fix unit tests with node v12.11.0
Unit tests cannot be executed with node v12.11.0 due to changes in `util.format`.
1 parent 58030cc commit 20d7ca3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/common/test/unit-tests/logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ describe("logger", () => {
162162
[undefined, null, false, "string value", 42, { obj: 1 }, ["string value 1", "string value 2"]].forEach(value => {
163163
it(`handles formatted message with '${value}' value in one of the args`, () => {
164164
logger.info("test %s", value);
165-
assert.equal(outputs.info, `test ${value}`);
165+
assert.equal(outputs.info, util.format("test %s", value));
166166
assert.deepEqual(outputs.context, {}, "Nothing should be added to logger context.");
167167
assert.deepEqual(outputs.removedContext, {}, "Removed context should be empty.");
168168
});
169169

170170
it(`handles formatted message with '${value}' value in one of the args and additional values passed to context`, () => {
171171
logger.info("test %s", value, { [LoggerConfigData.skipNewLine]: true });
172-
assert.equal(outputs.info, `test ${value}`);
172+
assert.equal(outputs.info, util.format("test %s", value));
173173
assert.deepEqual(outputs.context, { [LoggerConfigData.skipNewLine]: true }, `${LoggerConfigData.skipNewLine} should be set with value true.`);
174174
assert.deepEqual(outputs.removedContext, { [LoggerConfigData.skipNewLine]: true }, `Removed context should contain ${LoggerConfigData.skipNewLine}`);
175175
});

0 commit comments

Comments
 (0)