Last active
February 23, 2021 09:11
-
-
Save devxoul/5e56869af10146786ff9f6d97dc3b99e to your computer and use it in GitHub Desktop.
Use expect matcher in Apollo MockedProvider variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('@wry/equality', () => ({ | |
equal: (lhs: any, rhs: any) => { | |
const equals = require('expect/build/jasmineUtils').equals(lhs, rhs) | |
return equals || jest.requireActual('@wry/equality').equal(lhs, rhs) | |
} | |
})) | |
const mocks = [ | |
{ | |
request: { | |
query: MY_MUTATION, | |
variables: expect.anything() | |
} | |
} | |
] | |
<MockProvider mocks={mocks}> | |
</MockProvider> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment