From e1e8aee692dd0055e4f2b772590ad7386008c500 Mon Sep 17 00:00:00 2001 From: Elena Izaguirre Date: Tue, 16 Nov 2021 13:44:04 +0100 Subject: [PATCH] fix: added a dummy package added a dummy package for tests about install packages from github sources required for #1210 Signed-off-by: Elena Izaguirre --- .../resources/cactus-dummy-package/index.js | 24 +++++++++++++++++++ .../cactus-dummy-package/package.json | 6 +++++ 2 files changed, 30 insertions(+) create mode 100644 packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/index.js create mode 100644 packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/package.json diff --git a/packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/index.js b/packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/index.js new file mode 100644 index 0000000000..64fa272f4f --- /dev/null +++ b/packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/index.js @@ -0,0 +1,24 @@ +class DummyPlugin { + onPluginInit() { + console.log("DummyPlugin#onPluginInit() OK"); + return Promise.resolve(); + } + getInstanceId() { + console.log("DummyPlugin#getInstanceId() OK"); + return "dummy_instance_id"; + } + getPackageName() { + console.log("DummyPlugin#getPackageName() OK"); + return "@hyperledger/cactus-dummy-package"; + } +} + +class DummyPluginFactory { + create() { + return Promise.resolve(new DummyPlugin()); + } +} + +module.exports.createPluginFactory = (options) => { + return Promise.resolve(new DummyPluginFactory(options)); +}; diff --git a/packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/package.json b/packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/package.json new file mode 100644 index 0000000000..3e49001c07 --- /dev/null +++ b/packages/cactus-cmd-api-server/src/test/resources/cactus-dummy-package/package.json @@ -0,0 +1,6 @@ +{ + "name": "@hyperledger/cactus-dummy-package", + "version": "1.0.0-rc.2", + "description": "Dummy package for testing.", + "main": "index.js" + } \ No newline at end of file