Skip to content

Commit

Permalink
concrete in tests proper error behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Feb 20, 2019
1 parent 9f6ab6e commit 262a9ba
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/AppContainer.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class AppContainer extends React.Component {
// trigger update to kick error
this.setState({})
throw error
return
}
const { errorReporter = configuration.errorReporter } = this.props
if (!errorReporter) {
Expand Down
2 changes: 2 additions & 0 deletions test/AppContainer.dev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { AppContainer } from '../src/index.dev'
import RHL from '../src/reactHotLoader'
import {
closeGeneration,
configureGeneration,
increment as incrementGeneration,
} from '../src/global/generation'
import { configureComponent } from '../src/utils.dev'
Expand All @@ -18,6 +19,7 @@ import configuration from '../src/configuration'
describe(`AppContainer (dev)`, () => {
beforeEach(() => {
RHL.reset()
configureGeneration(1, 1)
})

describe('with class root', () => {
Expand Down
4 changes: 4 additions & 0 deletions test/proxy/consistency.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { createMounter, ensureNoWarnings } from './helper'
import createProxy from '../../src/proxy'
import configuration from '../../src/configuration'
import '../../src/index.dev'
import { configureGeneration } from '../../src/global/generation'

const createFixtures = () => ({
modern: {
Expand Down Expand Up @@ -68,6 +69,9 @@ const createFixtures = () => ({
})

describe('consistency', () => {
beforeEach(() => {
configureGeneration(1, 1)
})
ensureNoWarnings()
const { mount } = createMounter()

Expand Down
5 changes: 5 additions & 0 deletions test/proxy/lifecycle-method.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import React, { Component } from 'react'
import { createMounter } from './helper'
import createProxy from '../../src/proxy'
import '../../src/index.dev'
import { configureGeneration } from '../../src/global/generation'

describe('lifecycle method', () => {
beforeEach(() => {
configureGeneration(1, 1)
})

const { mount } = createMounter()

class Controller extends Component {
Expand Down
4 changes: 4 additions & 0 deletions test/reconciler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const spyComponent = (render, displayName, key) => {

describe('reconciler', () => {
describe('Application', () => {
beforeEach(() => {
configureGeneration(1, 1)
})

it('should regenerate internal component', () => {
const root = spyComponent(
({ children }) => <div>{children}</div>,
Expand Down

0 comments on commit 262a9ba

Please sign in to comment.