Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove unused code #1788

Merged
merged 1 commit into from Aug 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 1 addition & 18 deletions test/components/connect.spec.tsx
@@ -1,6 +1,6 @@
/*eslint-disable react/prop-types*/

import React, { Component, MouseEvent, ComponentType } from 'react'
import React, { Component, MouseEvent } from 'react'
import createClass from 'create-react-class'
import PropTypes from 'prop-types'
import ReactDOM from 'react-dom'
Expand Down Expand Up @@ -81,23 +81,6 @@ describe('React', () => {
return action.type === 'APPEND' ? prev + action.body : prev
}

function imitateHotReloading(
TargetClass: ComponentType,
SourceClass: ComponentType,
container: Component
) {
// Crude imitation of hot reloading that does the job
Object.getOwnPropertyNames(SourceClass.prototype)
.filter((key) => typeof SourceClass.prototype[key] === 'function')
.forEach((key) => {
if (key !== 'render' && key !== 'constructor') {
TargetClass.prototype[key] = SourceClass.prototype[key]
}
})

container.forceUpdate()
}

afterEach(() => rtl.cleanup())

describe('Core subscription and prop passing behavior', () => {
Expand Down