Skip to content

Commit

Permalink
fix: fix showMessage typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard86 committed Apr 12, 2022
1 parent 538229a commit 0747ece
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/lib/router-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test.afterEach(() => {
});

test.serial('should accept showError options when its true', async (t) => {
router = new RouterBuilder({ shoeMessage: true });
router = new RouterBuilder({ showMessage: true });

router.get(() => {
throw new Error('TEST_ERROR');
Expand All @@ -69,7 +69,7 @@ test.serial('should accept showError options when its true', async (t) => {
});

test.serial('should accept showError options when its false', async (t) => {
router = new RouterBuilder({ shoeMessage: false });
router = new RouterBuilder({ showMessage: false });

router.get(() => {
throw new Error('TEST_ERROR');
Expand Down
6 changes: 3 additions & 3 deletions src/lib/router-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type ErrorApiResponse = { success: false; message: string };
*/
export type RouterBuilderOptions = Partial<{
error: ApiErrorHandler;
shoeMessage: boolean;
showMessage: boolean;
}>;

/**
Expand Down Expand Up @@ -101,8 +101,8 @@ export class RouterBuilder {
this.routerOptions.error =
options.error ||
makeErrorHandler(
typeof options.shoeMessage === 'boolean'
? options.shoeMessage
typeof options.showMessage === 'boolean'
? options.showMessage
: process.env.NODE_ENV !== 'production'
);
}
Expand Down

0 comments on commit 0747ece

Please sign in to comment.