Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

How to capture arguments to an action #144

Open
sw-tracker opened this issue Aug 8, 2023 · 0 comments
Open

How to capture arguments to an action #144

sw-tracker opened this issue Aug 8, 2023 · 0 comments

Comments

@sw-tracker
Copy link

Hi there,

We are currently using storybook 7. And we would like to validate the arguments with which some actions are called. However, the other of the items needs to match exactly if we use the code below and this is making testing very difficult.

    expect(args.onError).toHaveBeenCalledWith(
      'ERROR_CODE',
      ['someError', 'someOtherError']
    );

We would like to capture the arguments so we can test them easier. How can we do this?

Thanks!

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

No branches or pull requests

1 participant