How to use the react-component-tree.__setStateMock function in react-component-tree

To help you get started, we’ve selected a few react-component-tree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-cosmos / react-cosmos / packages / react-cosmos / src / components / proxies / __tests__ / StateProxy.jsx View on Github external
const renderProxy = options => {
  fixture = options.fixture;
  onFixtureUpdate = jest.fn();

  jest.resetAllMocks();
  jest.useFakeTimers();

  ReactComponentTree.__setStateMock(options.initialState);

  StateProxy = createStateProxy({
    updateInterval: 1337,
  });
  wrapper = shallow(
     {}}
      fixture={fixture}
      onComponentRef={onComponentRef}
      onFixtureUpdate={onFixtureUpdate}
      disableLocalState={options.disabled}
    />,
  );
  childWrapper = wrapper.at(0);
  childProps = childWrapper.props();

react-component-tree

Serialize and reproduce the state of an entire tree of React components

MIT
Latest version published 7 years ago

Package Health Score

70 / 100
Full package analysis

Similar packages