google / intermock

Mocking library to create mock objects with fake data for TypeScript interfaces
https://google.github.io/intermock/
Apache License 2.0
1.14k stars 71 forks source link

Support specifying namespaced types #50

Open vyshane opened 3 years ago

vyshane commented 3 years ago

We are using gRPC-Web and it generates types similar to the following from protobuf definitions:

export namespace Todo {
  export type AsObject = {
    id: string,
    title: string,
    completed: boolean,
  }
}

export namespace GetTodoRequest {
  export type AsObject = {
    id: string,
  }
}

I would like to be able to call the intermock CLI with the option --interfaces "Todo.AsObject" "GetTodoRequest.AsObject".

Currently I'm only able to run --interfaces "AsObject", which only generates a mock for the very last AsObject type that intermock finds, i.e. GetTodoRequest.AsObject.