1.0.3 • Published 11 months ago

react-test-engine-vitest v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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.2

1 year ago

1.0.3

11 months ago

1.0.1

2 years ago

1.0.0

2 years ago