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

contains() matcher doesn't seem to work on arrays #31

Closed
searls opened this issue Oct 12, 2015 · 1 comment
Closed

contains() matcher doesn't seem to work on arrays #31

searls opened this issue Oct 12, 2015 · 1 comment
Labels

Comments

@searls
Copy link
Member

searls commented Oct 12, 2015

Looks like contains() doesn't work on arrays as intuitively as i thought (really failed to get it right at a training event)

@searls searls added the bug label Oct 12, 2015
@searls
Copy link
Member Author

searls commented Oct 21, 2015

this is fine.

td = require('testdouble')
drive = td.create('drive')
contains = td.matchers.contains

td.when(drive(contains('room'))).thenReturn("🚤")
drive('vroom') // "🚤"
drive('other stuff') // undefined
drive(['gloom', 'room']) // "🚤"

@searls searls closed this as completed Oct 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant