From ea9ebf5506bcfc6df2756c34e2ae675592a8195b Mon Sep 17 00:00:00 2001 From: Mara Kiefer <8320933+mnkiefer@users.noreply.github.com> Date: Fri, 13 Oct 2023 08:34:53 +0200 Subject: [PATCH] Improve plugin loading in tests (#24) --- package.json | 1 + tests/bookshop/package-lock.json | 3 --- tests/bookshop/package.json | 3 +++ tests/integration/fiori-draft-disabled.test.js | 6 ------ tests/integration/fiori-draft-enabled.test.js | 6 ------ tests/integration/service-api.test.js | 6 ------ 6 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 tests/bookshop/package-lock.json diff --git a/package.json b/package.json index 25c1c7a..08ddb43 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@sap/cds": "^7" }, "devDependencies": { + "@cap-js/change-tracking": "file:.", "@cap-js/sqlite": "^1", "axios": "^1", "chai": "^4.3.10", diff --git a/tests/bookshop/package-lock.json b/tests/bookshop/package-lock.json deleted file mode 100644 index 48e341a..0000000 --- a/tests/bookshop/package-lock.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lockfileVersion": 1 -} diff --git a/tests/bookshop/package.json b/tests/bookshop/package.json index 9de7f52..0aef0d6 100644 --- a/tests/bookshop/package.json +++ b/tests/bookshop/package.json @@ -1,4 +1,7 @@ { + "dependencies": { + "@cap-js/change-tracking": "*" + }, "devDependencies": { "@cap-js/sqlite": "*" }, diff --git a/tests/integration/fiori-draft-disabled.test.js b/tests/integration/fiori-draft-disabled.test.js index 18d8b59..ff57594 100644 --- a/tests/integration/fiori-draft-disabled.test.js +++ b/tests/integration/fiori-draft-disabled.test.js @@ -2,12 +2,6 @@ const cds = require("@sap/cds"); const bookshop = require("path").resolve(__dirname, "./../bookshop"); const { expect, data, POST, PATCH, DELETE } = cds.test(bookshop); -// REVISIT: should be easier to load the plugin and its model -cds.env.plugins["@cap-js/change-tracking"] = { - "impl": require("path").join(__dirname, "../../cds-plugin.js") -} -cds.env.roots.push("../../"); - jest.setTimeout(5 * 60 * 1000); let adminService = null; diff --git a/tests/integration/fiori-draft-enabled.test.js b/tests/integration/fiori-draft-enabled.test.js index 9124203..32b13d2 100644 --- a/tests/integration/fiori-draft-enabled.test.js +++ b/tests/integration/fiori-draft-enabled.test.js @@ -3,12 +3,6 @@ const bookshop = require("path").resolve(__dirname, "./../bookshop"); const { expect, data, POST, PATCH, DELETE } = cds.test(bookshop); const { RequestSend } = require("../utils/api"); -// REVISIT: should be easier to load the plugin and its model -cds.env.plugins["@cap-js/change-tracking"] = { - "impl": require("path").join(__dirname, "../../cds-plugin.js") -} -cds.env.roots.push("../../"); - jest.setTimeout(5 * 60 * 1000); let adminService = null; diff --git a/tests/integration/service-api.test.js b/tests/integration/service-api.test.js index 0c55bd6..b52aef8 100644 --- a/tests/integration/service-api.test.js +++ b/tests/integration/service-api.test.js @@ -2,12 +2,6 @@ const cds = require("@sap/cds"); const bookshop = require("path").resolve(__dirname, "./../bookshop"); const { expect, data } = cds.test(bookshop); -// REVISIT: should be easier to load the plugin and its model -cds.env.plugins["@cap-js/change-tracking"] = { - "impl": require("path").join(__dirname, "../../cds-plugin.js") -} -cds.env.roots.push("../../"); - jest.setTimeout(5 * 60 * 1000); let adminService = null;