<commit_before>import { shallow } from 'enzyme';
import React from 'react';

import Component from './component';

let counter = 0;
const uniqueId = (prefix) => prefix + counter++;

function getUniqueState() {
	return { [uniqueId('stateVarName')]: uniqueId('stateVarValue') };
}

function getUniqueProps() {
	return { [uniqueId('propName')]: uniqueId('propValue') };
}

describe('Component extension', () => {
	let component;

	class TestComponent extends Component {
		constructor(props) {
			super(props);
			this.state = getUniqueState();
		}
	}

	TestComponent.prototype.componentWillMountOrReceiveProps = jest.fn().mockReturnThis();
	TestComponent.prototype.componentDidMountOrUpdate = jest.fn().mockReturnThis();
	TestComponent.prototype.render = jest.fn().mockReturnThis();

	beforeEach(() => {
		component = shallow(<TestComponent {...getUniqueProps()} />);
	});

	describe('componentWillMountOrReceiveProps()', () => {
		const { componentWillMountOrReceiveProps, render } = TestComponent.prototype;<commit_msg>Fix tests on React 15<commit_after>import { shallow } from 'enzyme';
import React from 'react';

import Component from './component';

let counter = 0;
const uniqueId = (prefix) => prefix + counter++;

function getUniqueState() {
	return { [uniqueId('stateVarName')]: uniqueId('stateVarValue') };
}

function getUniqueProps() {
	return { [uniqueId('propName')]: uniqueId('propValue') };
}

describe('Component extension', () => {
	let component;

	class TestComponent extends Component {
		constructor(props) {
			super(props);
			this.state = getUniqueState();
		}
	}

	TestComponent.prototype.componentWillMountOrReceiveProps = jest.fn().mockReturnThis();
	TestComponent.prototype.componentDidMountOrUpdate = jest.fn().mockReturnThis();
	TestComponent.prototype.render = jest.fn().mockReturnValue(null);

	beforeEach(() => {
		component = shallow(<TestComponent {...getUniqueProps()} />);
	});

	describe('componentWillMountOrReceiveProps()', () => {
		const { componentWillMountOrReceiveProps, render } = TestComponent.prototype;
{'fraction_non_alphanumeric': 0.15309605070697221, 'fraction_numerical': 0.0019502681618722574, 'mean_word_length': 5.909090909090909, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '7182372', 'n_tokens_mistral': 615, 'n_tokens_neox': 573, 'n_words': 117}