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

Nested objects aren't typed as DeepMocked #885

Closed
NickBolles opened this issue Dec 16, 2024 · 2 comments · May be fixed by #884
Closed

Nested objects aren't typed as DeepMocked #885

NickBolles opened this issue Dec 16, 2024 · 2 comments · May be fixed by #884
Labels

Comments

@NickBolles
Copy link

export class MyClass {
  foo = {
    bar: () => {
      return 'foo.bar';
    },
  };
}

test('foo.bar', () => {
  const myMock = createMock<MyClass>();

  myMock.foo.bar.mockResolvedValue('foo.bar');
});
image

Based off the createMock source this nested object should also be a mock. Updating the typings as suggested in #884 fixes this error

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 16, 2025
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant