google/intermock

@mockType for aliases

Rody-Kirwan opened this issue · 2 comments

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: [ {}, {}, {} ]
}

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

jasco commented

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