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

@lakerswgq

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions