Skip to content

Commit

Permalink
[FIX] Typos in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Oct 22, 2020
1 parent cc55464 commit 1d25902
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const levels = ["silly", "verbose", "info", "warn", "error", "silent"];
if (process.env.UI5_LOG_LVL) {
const logLvl = process.env.UI5_LOG_LVL;
if (!levels.includes(logLvl)) {
throw new Error(`UI5 Logger: Environment variable UI5_LOG_LVL is set to an unkown log level "${logLvl}". ` +
throw new Error(`UI5 Logger: Environment variable UI5_LOG_LVL is set to an unknown log level "${logLvl}". ` +
`Valid levels are ${levels.join(", ")}`);
}
npmlog.level = logLvl;
Expand Down Expand Up @@ -134,7 +134,7 @@ const logger = {

setLevel(level) {
if (!levels.includes(level)) {
throw new Error(`Unkown log level "${level}"`);
throw new Error(`Unknown log level "${level}"`);
}
return npmlog.level = level;
},
Expand Down
4 changes: 2 additions & 2 deletions test/lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test.serial("setLevel", (t) => {
logger.setLevel("silly");
t.is(t.context.npmLogStub.level, "silly", "npmlog.level should be set to 'silly'");

t.throws(() => logger.setLevel("fancy"), {message: `Unkown log level "fancy"`});
t.throws(() => logger.setLevel("fancy"), {message: `Unknown log level "fancy"`});
t.is(t.context.npmLogStub.level, "silly", "npmlog.level should still be set to 'silly'");
});

Expand Down Expand Up @@ -143,7 +143,7 @@ test.serial("Environment variable UI5_LOG_LVL (invalid)", (t) => {
t.throws(() => {
mock.reRequire("../../lib/logger");
}, {
message: `UI5 Logger: Environment variable UI5_LOG_LVL is set to an unkown log level "all". ` +
message: `UI5 Logger: Environment variable UI5_LOG_LVL is set to an unknown log level "all". ` +
`Valid levels are silly, verbose, info, warn, error, silent`
});
});
Expand Down

0 comments on commit 1d25902

Please sign in to comment.