From a42172fc341666b8d9a9b6049c365b28c55c76f0 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Mon, 11 May 2020 10:59:23 +0200 Subject: [PATCH] [FIX] Allow the use of specVersion 2.1 for projects https://github.com/SAP/ui5-project/pull/308 only allowed the use of the new spec version for extensions. --- lib/projectPreprocessor.js | 3 ++- test/lib/projectPreprocessor.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/projectPreprocessor.js b/lib/projectPreprocessor.js index 6132866b2..b85870ce0 100644 --- a/lib/projectPreprocessor.js +++ b/lib/projectPreprocessor.js @@ -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. ` + diff --git a/test/lib/projectPreprocessor.js b/test/lib/projectPreprocessor.js index c5784c8d1..bfd55f0fb 100644 --- a/test/lib/projectPreprocessor.js +++ b/test/lib/projectPreprocessor.js @@ -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({});