Skip to content

@mockType for aliases #18

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

Open
Rody-Kirwan opened this issue Feb 19, 2020 · 2 comments
Open

@mockType for aliases #18

Rody-Kirwan opened this issue Feb 19, 2020 · 2 comments

Comments

@Rody-Kirwan
Copy link

I am not an expert at typescript, but I am using interfaces as a descriptive tool to describe my application state model. This lib is great.

It would be really useful if you could set `@mockType at an alias level for instance:

type UserId = string /** @mockType {random.uuid} */

interface User {
  userId: UserId
  group: UserId[]
}

// returns

{
   userId: 97896447-4453-4718-990d-1d2a5f38533b,
   group: [ 28939844-74c4-4907-b596-41f1382a2607 ]
}

Currently my Array of string types returns:

{
   userId: 97896447-4453-4718-990d-1d2a5f38533b,
   group: [ {}, {}, {} ]
}
@ryanmcdermott
Copy link
Member

This is a good idea! I'd happily accept a PR.

@jasco
Copy link

jasco commented Oct 9, 2020

I have a patch for this but it is layered on top of #42

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

3 participants