@types/redux-testkit
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Installation

npm install --save @types/redux-testkit

Summary

This package contains type definitions for redux-testkit (https://github.com/wix/redux-testkit#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-testkit.

index.d.ts

import * as Redux from "redux";
import { ThunkAction } from "redux-thunk";

export interface ReducerTestkit {
    expect: (action: Redux.Action) => {
        toReturnState(expected: any): void;
        toStayTheSame(): void;
        toChangeInState(expectedChanges: any): void;
    };
    execute(action: Redux.Action): any; // state
}

export interface ThunkTestkit {
    execute(...args: any[]): any;
}

export function Reducer(action: Redux.Reducer): ReducerTestkit & {
    withState(state: any): ReducerTestkit;
};

export function Selector(selector: (state: any, action: any) => any): {
    expect(state: any, ...args: any[]): {
        toReturn(expected: any): void;
    };
    execute(state: any, ...args: any[]): any;
};

export function Thunk(thunkFunc: ThunkAction<any, any, any, any>, extraArg?: any): ThunkTestkit & {
    withState(state: any): ThunkTestkit;
};

export namespace FlushThunks {
    function createMiddleware(): Redux.Middleware & {
        flush(): void;
        reset(): void;
    };
}

Additional Details

Credits

These definitions were written by Andrey Kizimov.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/redux-testkit

Weekly Downloads

2,372

Version

1.0.8

License

MIT

Unpacked Size

4.75 kB

Total Files

5

Last publish

Collaborators

  • types