add more tests

This commit is contained in:
Michael Telatynski 2021-04-23 09:55:30 +01:00
parent fba7465ad4
commit 1075756929
3 changed files with 76 additions and 11 deletions

View file

@ -15,7 +15,10 @@ limitations under the License.
*/
import { MatrixClient } from "matrix-js-sdk/src/client";
import {AsyncStoreWithClient} from "../../src/stores/AsyncStoreWithClient";
import { AsyncStoreWithClient } from "../../src/stores/AsyncStoreWithClient";
// These methods make some use of some private methods on the AsyncStoreWithClient to simplify getting into a consistent
// ready state without needing to wire up a dispatcher and pretend to be a js-sdk client.
export const setupAsyncStoreWithClient = async (store: AsyncStoreWithClient<any>, client: MatrixClient) => {
// @ts-ignore
@ -23,3 +26,8 @@ export const setupAsyncStoreWithClient = async (store: AsyncStoreWithClient<any>
// @ts-ignore
await store.onReady();
};
export const resetAsyncStoreWithClient = async (store: AsyncStoreWithClient<any>) => {
// @ts-ignore
await store.onNotReady();
};