From 1a09fcd26f5ff577c408edaca5d6ca890da2d734 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 24 Jul 2022 08:06:32 -0700 Subject: [PATCH] fix(mocks): Improvement to adapter mocks used in tests --- test/unit/mocks/adapters/index.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test/unit/mocks/adapters/index.js b/test/unit/mocks/adapters/index.js index a236014..3165c92 100644 --- a/test/unit/mocks/adapters/index.js +++ b/test/unit/mocks/adapters/index.js @@ -2,12 +2,15 @@ Mocks for the Adapter library. */ -const ipfs = { - ipfsAdapter: { - ipfs: {} - }, - ipfsCoordAdapter: { - ipfsCoord: { +class IpfsAdapter { + constructor () { + this.ipfs = {} + } +} + +class IpfsCoordAdapter { + constructor () { + this.ipfsCoord = { useCases: { peer: { sendPrivateMessage: () => {} @@ -17,6 +20,11 @@ const ipfs = { } } +const ipfs = { + ipfsAdapter: new IpfsAdapter(), + ipfsCoordAdapter: new IpfsCoordAdapter() +} + const localdb = { Users: class Users { static findById () {}