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

Capture arguments passed to method on mocked object #132

Open
gusgorman2 opened this issue Apr 22, 2024 · 0 comments
Open

Capture arguments passed to method on mocked object #132

gusgorman2 opened this issue Apr 22, 2024 · 0 comments

Comments

@gusgorman2
Copy link

gusgorman2 commented Apr 22, 2024

Hi,

Is there any way to capture arguments passed to a method on a mocked object.

For example, if we have:

export abstract class StatusDao {
  abstract getWhere(codes: string[]): Promise<Status>
}

and then:

const statusDao: MockProxy<StatusDao> = mock<StatusDao>()

would there any way to capture any arguments passed to getWhere ?

I know I can use expect(statusDao.getWhere).toHaveBeenCalledWith() but this doesn't always quite do what i want

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

1 participant