<commit_before>import React from 'react';
import { shallow, mount, ShallowWrapper, ReactWrapper } from 'enzyme';

function makeShallowRenderer<Props>(Component: React.ComponentType<Props>, defaultProps: Props) {
  return (props: Partial<Props> = {}): ShallowWrapper<Props> => (
    shallow(<Component {...defaultProps} {...props} />)
  );
}

function makeMountRenderer<Props>(Component: React.ComponentType<Props>, defaultProps: Props) {
  return (props: Partial<Props> = {}): ReactWrapper<Props> => (
    mount(<Component {...defaultProps} {...props} />)
  );
}

export { makeShallowRenderer, makeMountRenderer };<commit_msg>Demo app tests: add state type to make*Renderer #74<commit_after>import React from 'react';
import { shallow, mount, ShallowWrapper, ReactWrapper } from 'enzyme';

function makeShallowRenderer<Props, State>(
  Component: React.ComponentClass<Props, State> | React.FunctionComponent<Props>, defaultProps: Props,
) {
  return (props: Partial<Props> = {}): ShallowWrapper<Props, State> => (
    shallow(<Component {...defaultProps} {...props} />)
  );
}

function makeMountRenderer<Props, State>(
  Component: React.ComponentClass<Props, State> | React.FunctionComponent<Props>, defaultProps: Props,
) {
  return (props: Partial<Props> = {}): ReactWrapper<Props, State> => (
    mount(<Component {...defaultProps} {...props} />)
  );
}

export { makeShallowRenderer, makeMountRenderer };
{'fraction_non_alphanumeric': 0.16099290780141845, 'fraction_numerical': 0.0014184397163120568, 'mean_word_length': 5.624413145539906, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6317435', 'n_tokens_mistral': 415, 'n_tokens_neox': 408, 'n_words': 94}