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

Generic Interface mock as empty object #74

Open lakerswgq opened 2 years ago

lakerswgq commented 2 years ago

My ts file is like this:

interface User {
  name: string;
  age: number;
  gender: 'male' | 'female';
}

interface IResponse<T> {
  code: number;
  data: T;
}

export interface UserResponse extends IResponse<User> {}; 

And i got mock data like this:

{
  User: { name: 'Diamond Grant', age: 57103, gender: 'female' },
  IResponse: { code: 14453, data: {} },
  UserResponse: { code: 68883, data: {} }
}

All my generic type result in empty object