altjs / utils

A collection of utils for alt.js
37 stars 25 forks source link

[AltTestingUtils] Add support to send constructor args in makeStoreTestable() #28

Open gaurav414u opened 6 years ago

gaurav414u commented 6 years ago

I have a number of Alt-Stores which require dependencies in the form of constructorArgs. When I use AltTestingUtils.makeStoreTestable(myAltInstance, MyUnWrappedStore) it fails for obvious reasons. As there is no way to send constructor args in AltTestingUtils.makeStoreTestable(). Ideally it should be there because alt.createStore() also supports this (StoreModel: function, iden: ?string, …constructorArgs): AltStore (docs).

I have almost made the changes and will make a pull request in a bit.