diff --git a/test/typescript/store.ts b/test/typescript/store.ts index 55948e1329..834fb55686 100644 --- a/test/typescript/store.ts +++ b/test/typescript/store.ts @@ -61,6 +61,11 @@ const funcWithStore = (store: Store) => {} const store: Store = createStore(reducer) +// test that nullable state is preserved +const nullableStore = createStore((): string | null => null) + +expectTypeOf(nullableStore.getState()).toEqualTypeOf() + // ensure that an array-based state works const arrayReducer = (state: any[] = []) => state || [] const storeWithArrayState: Store = createStore(arrayReducer)