Skip to content

Commit

Permalink
Code coverage issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Apr 22, 2024
1 parent 5726161 commit 7756db6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
21 changes: 9 additions & 12 deletions src/app/errors/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,23 @@ type Params = {
url: string;
};

const loadableArgs = {
loader: () => import(/* webpackChunkName: "LoaderCentered" */ './components/LoaderCentered'),
loading: () => null,
modules: ['LoaderCentered'],
webpack: /* istanbul ignore next */ () => [(require as any).resolveWeak('./components/LoaderCentered')],
};

export const notFound: Route<Params> = {
component: Loadable({
loader: () => import(/* webpackChunkName: "LoaderCentered" */ './components/LoaderCentered'),
loading: () => null,
modules: ['LoaderCentered'],
webpack: /* istanbul ignore next */ () => [(require as any).resolveWeak('./components/LoaderCentered')],
}),
component: Loadable(loadableArgs),
getSearch: (params: Params): string => `path=${params.url}`,
getUrl: (_params: Params) => '/error/404',
name: 'NotFound',
paths: [CATCH_ALL],
};

export const external: Route<Params> = {
component: Loadable({
loader: () => import(/* webpackChunkName: "LoaderCentered" */ './components/LoaderCentered'),
loading: () => null,
modules: ['LoaderCentered'],
webpack: /* istanbul ignore next */ () => [(require as any).resolveWeak('./components/LoaderCentered')],
}),
component: Loadable(loadableArgs),
getUrl: (params: Params) => params.url,
name: 'External',
paths: [':url(/.*)'],
Expand Down
4 changes: 2 additions & 2 deletions src/app/navigation/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ describe('findRouteMatch', () => {
});

it('returns undefined for missing param values', () => {
const location = {pathname: '/with'} as Location;
const location = '/with';
const result = findRouteMatch(routes, location);
expect(result).toEqual({route: routes[1], params: {param: undefined}, state: {}});
expect(result).toEqual({route: routes[1], params: {param: undefined}, state: false});
});
});

Expand Down

0 comments on commit 7756db6

Please sign in to comment.