Benjamin Kay

Results 26 comments of Benjamin Kay

hey @acostalima, did you manage to do this? if not I am happy enough to raise a PR for this as it would be helpful for myself anyways.

Ahh I hadn't seen this 😢 it explains the changes to toHaveBeenCalledBefore that have been merged in but not published here. It might be worth asking for this to be...

I like this, i can see a use case for it, i've wrote this for context, as I feel the jest matchers names arn't really that clear, and your suggestion...

So for example, these are the behavious i would expect from such a matcher: ``` javascript describe('test use case toMatchAtleastOnce', () => { it('toMatchAtleastOnce Strings', () => { const example...

I don't know how we would deal with this use case though, objects in nested arrays, ``` javascript it('toMatchAtleastOnce Objects', () => { const example = [ [ { addivional:...

from .toMatchAtleastOnce() i can see a case being drawn for a whole raft of matchers: * toMatchAtleastOnce() * toMatchExactlyOnce() * toMatchAtleastTimes() * toMatchExactlyTimes() \/ Uses strict equality * toMatchAtPosition(val, position)...

Thats the same use case for me, a step beyond this would be schema testing, maybe we could wrap a an ajv schema testing into a matcher aswell, i would...

maybe we give the option to include a predicate, then people can write their own thing to check these things with a passed in function?

so something like this? I feel this is a pretty simple thing to have, maybe have a default of range 1 when its not passed. ``` describe('test examples', () =>...

so in short, these should all pass? ``` it('toBeNear', () => { expect(10.31415).toBeNear(10) expect(10.31415).toBeNear(10, 2) expect(10.31415).not.toBeNear(10, 0.3) }) ```