Skip to content

Commit 284cd63

Browse files
committed
[INTERNAL] ui5Framework: Change error message wording
1 parent fb1db6d commit 284cd63

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lib/graph/helpers/ui5Framework.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ const utils = {
200200

201201
if (duplicateFrameworkProjectNames.length) {
202202
throw new Error(
203-
`Duplicate framework library definition(s) found in project ${projectGraph.getRoot().getName()}: ` +
204-
`${duplicateFrameworkProjectNames.join(", ")}. ` +
205-
`Framework libraries should only be referenced via ui5.yaml configuration, ` +
206-
`not in its dependencies (e.g. package.json). ` +
207-
`Note that this error could also come from transitive dependencies.`
203+
`Duplicate framework dependency definition(s) found for project ${projectGraph.getRoot().getName()}: ` +
204+
`${duplicateFrameworkProjectNames.join(", ")}.\n` +
205+
`Framework libraries should only be referenced via ui5.yaml configuration. ` +
206+
`Neither the root project, nor any of its dependencies should include them as direct ` +
207+
`dependencies (e.g. via package.json).`
208208
);
209209
}
210210
},

test/lib/graph/helpers/ui5Framework.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,9 @@ test.serial("enrichProjectGraph should throw error when projectGraph contains a
555555
const projectGraph = await projectGraphBuilder(provider);
556556

557557
await t.throwsAsync(ui5Framework.enrichProjectGraph(projectGraph), {
558-
message: `Duplicate framework library definition(s) found in project application.a: sap.ui.core. ` +
559-
`Framework libraries should only be referenced via ui5.yaml configuration, not in its ` +
560-
`dependencies (e.g. package.json). Note that this error could also come from transitive dependencies.`
558+
message: `Duplicate framework dependency definition(s) found for project application.a: sap.ui.core.\n` +
559+
`Framework libraries should only be referenced via ui5.yaml configuration. Neither the root project, ` +
560+
`nor any of its dependencies should include them as direct dependencies (e.g. via package.json).`
561561
});
562562
});
563563

@@ -1074,10 +1074,10 @@ test("utils.checkForDuplicateFrameworkProjects: One duplicate", (t) => {
10741074
};
10751075

10761076
t.throws(() => utils.checkForDuplicateFrameworkProjects(projectGraph, frameworkGraph), {
1077-
message: "Duplicate framework library definition(s) found in project root-project: " +
1078-
"sap.ui.core. " +
1079-
"Framework libraries should only be referenced via ui5.yaml configuration, not in its dependencies " +
1080-
"(e.g. package.json). Note that this error could also come from transitive dependencies."
1077+
message: "Duplicate framework dependency definition(s) found for project root-project: " +
1078+
"sap.ui.core.\n" +
1079+
"Framework libraries should only be referenced via ui5.yaml configuration. Neither the root project, " +
1080+
"nor any of its dependencies should include them as direct dependencies (e.g. via package.json)."
10811081
});
10821082
});
10831083

@@ -1095,10 +1095,10 @@ test("utils.checkForDuplicateFrameworkProjects: Two duplicates", (t) => {
10951095
};
10961096

10971097
t.throws(() => utils.checkForDuplicateFrameworkProjects(projectGraph, frameworkGraph), {
1098-
message: "Duplicate framework library definition(s) found in project root-project: " +
1099-
"sap.ui.core, sap.ui.layout. " +
1100-
"Framework libraries should only be referenced via ui5.yaml configuration, not in its dependencies " +
1101-
"(e.g. package.json). Note that this error could also come from transitive dependencies."
1098+
message: "Duplicate framework dependency definition(s) found for project root-project: " +
1099+
"sap.ui.core, sap.ui.layout.\n" +
1100+
"Framework libraries should only be referenced via ui5.yaml configuration. Neither the root project, " +
1101+
"nor any of its dependencies should include them as direct dependencies (e.g. via package.json)."
11021102
});
11031103
});
11041104

0 commit comments

Comments
 (0)