From f84897df6c3cfe35dde9eba6dfdd75b92b0ee8bf Mon Sep 17 00:00:00 2001 From: dschutte97 Date: Fri, 21 Jan 2022 07:49:00 +0100 Subject: [PATCH] fix: Add duplicate function to support instance duplication for TypeScript mocks (#1109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniƫl Schutte --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index 006473432..77c6bba6a 100644 --- a/src/index.js +++ b/src/index.js @@ -106,6 +106,10 @@ class RedisMock extends EventEmitter { return mock; } + duplicate() { + return this.createConnectedClient() + } + // eslint-disable-next-line class-methods-use-this disconnect() { const removeFrom = ({ instanceListeners }) => {