1.0.1 • Published 5 months ago

react-test-engine-vitest v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-test-engine-vitest

NPM dependencies status

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];
  // },
});
1.0.1

5 months ago

1.0.0

7 months ago