From ae43b6eebdbf02b00f0b9711074a94254308cac6 Mon Sep 17 00:00:00 2001 From: Gaurav Bhola Date: Tue, 2 Jan 2018 12:16:03 +0530 Subject: [PATCH] Updated AltTestingUtils to support constructor args for stores --- src/AltTestingUtils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AltTestingUtils.js b/src/AltTestingUtils.js index 204bfe5..91f4428 100644 --- a/src/AltTestingUtils.js +++ b/src/AltTestingUtils.js @@ -22,15 +22,15 @@ const AltTestingUtils = { } }, - makeStoreTestable(alt, UnwrappedStore) { + makeStoreTestable(alt, UnwrappedStore, ...constructorArgs) { const StorePrototype = AltTestingUtils.createStoreSpy(alt) class DerivedStore extends UnwrappedStore { - constructor() { - super() + constructor(...args) { + super(...args) } } assign(DerivedStore.prototype, StorePrototype) - return new DerivedStore() + return new DerivedStore(...constructorArgs) }, mockGetState(state = {}) {