Skip to content

Using Omit with createMock returns undefined #958

@guidiamond

Description

@guidiamond

Bug: Using Omit with interface when calling createMock returns undefined

If you try to use Omit with an interface when calling createMock it returns undefined.

Your environment

  • ts-auto-mock version: 3.5.0
  • typescript version: 4.1.3
  • node version: 14.17.3
  • yarn version: 1.22.11

Steps to reproduce

interface Person {
  name: string;
  password: string;
}

const personWithoutName = createMock<Omit<Person,"name">>();
console.log(personWithoutName); // Returns undefined

Expected behavior

interface Person {
  name: string;
  password: string;
}

const personWithoutName = createMock<Omit<Person,"name">>();
console.log(personWithoutName); // { password: "" }

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