Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Generic Interface mock as empty object #74

Description

@lakerswgq

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions