Skip to content

Commit 6dac124

Browse files
committed
[INTERNAL] Tree: Do not log null for projects with empty namespace
This is related to a change in ui5-project. The Project class now always implements a getNamespace function, but types like ThemeLibrary or Module return null. Before, those types did not implement the function at all.
1 parent af9614b commit 6dac124

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/cli/commands/tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ tree.handler = async function(argv) {
5555
const connectorString = lastChild ? "╰─" : "├─";
5656
console.log(
5757
`${baseString}${connectorString} ${chalk.bold(project.getName())} ` +
58-
`${project.getNamespace ? chalk.inverse(project.getNamespace()) + " " : ""}` +
58+
`${project.getNamespace() ? chalk.inverse(project.getNamespace()) + " " : ""}` +
5959
chalk.dim(`(${project.getVersion()}, ${project.getType()}) `) +
6060
chalk.dim.italic(`${project.getPath()}`)
6161
);

test/lib/cli/commands/tree.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ test.serial("ui5 tree", async (t) => {
108108
await fn({
109109
project: {
110110
getName: sinon.stub().returns("dependency1"),
111+
getNamespace: sinon.stub().returns(null),
111112
getVersion: sinon.stub().returns("1.1.1"),
112113
getType: sinon.stub().returns("library"),
113114
getPath: sinon.stub().returns("/home/dependency1")
@@ -117,6 +118,7 @@ test.serial("ui5 tree", async (t) => {
117118
await fn({
118119
project: {
119120
getName: sinon.stub().returns("dependency3"),
121+
getNamespace: sinon.stub().returns(null),
120122
getVersion: sinon.stub().returns("3.3.3"),
121123
getType: sinon.stub().returns("library"),
122124
getPath: sinon.stub().returns("/home/dependency3")

0 commit comments

Comments
 (0)