Skip to content

Commit

Permalink
fix: msw (orval-labs#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
reichhartd authored Aug 15, 2022
1 parent f9de0d1 commit e18539d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/generators/msw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const generateMSW = (
: '',
handler: `rest.${verb}('${route}', (_req, res, ctx) => {
return res(
ctx.delay(${override?.mock?.delay || 1000}),
ctx.delay(${override?.mock?.delay ?? 1000}),
ctx.status(200, 'Mocked status'),${
value && value !== 'undefined'
? `\nctx.${responseType}(get${pascal(operationId)}Mock()),`
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export type OverrideOutput = {
format?: { [key: string]: unknown };
required?: boolean;
baseUrl?: string;
delay?: number;
};
contentType?: OverrideOutputContentType;
header?: boolean | ((info: InfoObject) => string[] | string);
Expand Down

0 comments on commit e18539d

Please sign in to comment.