relay
relay copied to clipboard
[relay-test-utils] createMockEnvironment expects jest to be defined
The package.json
file of relay-test-utils
does not require jest
, but attempting to use createMockEnvironment
in any test runner except for jest
will result in the following error:
ReferenceError: jest is not defined
at mockDisposableMethod (node_modules/relay-test-utils/lib/RelayModernMockEnvironment.js:40:17)
at Object.createMockEnvironment (node_modules/relay-test-utils/lib/RelayModernMockEnvironment.js:354:5)
It looks like RelayModernMockEnvironment
utilizes jest.fn
under the hood to create mock methods on the Environment
object.
This issue prevents users from using createMockEnvironment
with test runners such as vitest, mocha
, jasmine
, ava, etc.
Reproduction using mocha
: https://glitch.com/edit/#!/frost-tulip-polka