Skip to content

Commit

Permalink
[FIX] Allow the use of specVersion 2.1 for projects
Browse files Browse the repository at this point in the history
#308 only allowed the use of the
new spec version for extensions.
  • Loading branch information
RandomByte committed May 11, 2020
1 parent 8693ea3 commit a42172f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/projectPreprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ class ProjectPreprocessor {
}

if (project.specVersion !== "0.1" && project.specVersion !== "1.0" &&
project.specVersion !== "1.1" && project.specVersion !== "2.0") {
project.specVersion !== "1.1" && project.specVersion !== "2.0" &&
project.specVersion !== "2.1") {
throw new Error(
`Unsupported specification version ${project.specVersion} defined for project ` +
`${project.id}. Your UI5 CLI installation might be outdated. ` +
Expand Down
16 changes: 16 additions & 0 deletions test/lib/projectPreprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,22 @@ test("specVersion: Project with valid version 2.0", async (t) => {
t.deepEqual(res.specVersion, "2.0", "Correct spec version");
});

test("specVersion: Project with valid version 2.1", async (t) => {
const tree = {
id: "application.a",
path: applicationAPath,
dependencies: [],
version: "1.0.0",
specVersion: "2.1",
type: "application",
metadata: {
name: "xy"
}
};
const res = await projectPreprocessor.processTree(tree);
t.deepEqual(res.specVersion, "2.1", "Correct spec version");
});

test("isBeingProcessed: Is not being processed", (t) => {
const preprocessor = new projectPreprocessor._ProjectPreprocessor({});

Expand Down

0 comments on commit a42172f

Please sign in to comment.