Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: typescript, only handlers #15

Closed
pikilon opened this issue Nov 6, 2022 · 1 comment
Closed

Suggestion: typescript, only handlers #15

pikilon opened this issue Nov 6, 2022 · 1 comment

Comments

@pikilon
Copy link

pikilon commented Nov 6, 2022

I am very impressed with the library, very useful.

I had to implement it by adding a d.ts file in order to work in my repository. I think it would be a good addition to it.

I also think the library should be decoubled from MSW implementation, so it removes work for you and usage will not add unused code.
With this addition in mind we could even have parameters to modify handlers individually to differents tests scenarios.

Thank you again and keep on the good work!

@zoubingwu
Copy link
Owner

@pikilon hey since v0.11.0 the generated code will have all response in a get function, the name was derived from operationId in the OpenAPI spec, for example:

export function getEnterpriseAdminUpdateOrgName202Response() {
  return {
    message: faker.lorem.slug(1),
    url: faker.internet.url(),
  };
}

I hope this will be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants