Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Omit with createMock returns undefined #958

Open
guidiamond opened this issue Oct 22, 2021 · 1 comment
Open

Using Omit with createMock returns undefined #958

guidiamond opened this issue Oct 22, 2021 · 1 comment

Comments

@guidiamond
Copy link

guidiamond commented Oct 22, 2021

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: "" }
@uittorio
Copy link
Member

@guidiamond hi!!!

I think this is related to another issue where we dont support mapped types. I may give it another go to see if we can fix it, but I can't promise when.

I am wondering if there is anything else you could use while waiting for the fix. @Pmyl sorry for throwing you in the mix, do you have any ideas?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants