react-test-engine-vitest
v1.0.3
Published
Integration of react-test-engine and vitest
Downloads
51
Readme
react-test-engine-vitest
Integration of react-test-engine
and vitest
The api of this wrapper is the api of react-test-engine
. But mockFunctionValue
and getMockArguments
for testing hooks are provided automatically.
Installation
npm install react-test-engine-vitest react-test-engine react-test-renderer react-is --save-dev
or
yarn add react-test-engine-vitest react-test-engine react-test-renderer react-is --dev
Usage
import { create } from 'react-test-engine-vitest';
const render = create(Component, defaultProps, {
...otherOptions,
/**
* You don't have to provide this
*/
// mockFunctionValue: (hook, value) => {
// vi.mocked(hook).mockReturnValueOnce(value);
// },
// getMockArguments: (hook, callIndex) => {
// return vi.mocked(hook).mock.calls[callIndex];
// },
});