Skip to content

Commit

Permalink
Add mocks entry point (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogasparin authored Oct 12, 2020
1 parent dc16af6 commit 79c1c6a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
5 changes: 5 additions & 0 deletions mocks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"main": "../build/cjs/mocks.js",
"module": "../build/esm/mocks.js",
"types": "../build/esm/mocks.d.ts"
}
23 changes: 21 additions & 2 deletions src/mocks.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,32 @@
import type { BoundActions } from 'react-sweet-state';

import type {
Location,
Match,
MatchedRoute,
Query,
Route,
RouteContext,
RouterActionsType,
RouterContext,
RouteResourceResponse,
} from './types.js.flow';

declare export var mockRoute: Route;
declare export var mockRouterActions: BoundActions<RouterActionsType>;
declare export var mockRouterContextProp: RouteContext;
declare export var mockRouterStoreContextProp: RouterContext;
declare export var mockRouterStoreContext: RouterContext;
declare export function mockRouterStoreContextProp(
key: string,
mock: { ... }
): RouterContext;
declare export var mockLocation: Location;
declare export var mockMatch: Match;
declare export var mockMatchedRoute: MatchedRoute;
declare export var mockQuery: Query;
declare export var mockRouteContext: RouteContext;
declare export function mockRouteContextProp(
key: string,
mock: { ... }
): RouteContext;
declare export var mockRouteResourceResponse: RouteResourceResponse;
declare export var mockRoutes: Route[];

0 comments on commit 79c1c6a

Please sign in to comment.