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

Reconsider: AssertOrder.on() #129

Open
unional opened this issue Jul 18, 2019 · 1 comment
Open

Reconsider: AssertOrder.on() #129

unional opened this issue Jul 18, 2019 · 1 comment

Comments

@unional
Copy link
Owner

unional commented Jul 18, 2019

The invocation is weird. And the following does not work:

const o = AssertOrder(2)

const cb = (i) => {
  o.any([1,2])
  o.on(2, () => expect(i).toBe(2))
}

cb(1)
cb(2)

It got i = 1.

The following works:

const o = AssertOrder(2)

const cb = (i) => {
  o.on(2, () => expect(i).toBe(2))
  o.any([1,2])
}

cb(1)
cb(2)
@unional
Copy link
Owner Author

unional commented Jun 26, 2023

This is partially addressed by o.any([1, 2], (step) => /* do something */)

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

No branches or pull requests

1 participant