From 262a9ba617604d52a6d22fa785a6dbac3596d0c6 Mon Sep 17 00:00:00 2001 From: Anton Korzunov Date: Wed, 20 Feb 2019 18:00:58 +1100 Subject: [PATCH] concrete in tests proper error behavior --- src/AppContainer.dev.js | 1 - test/AppContainer.dev.test.js | 2 ++ test/proxy/consistency.test.js | 4 ++++ test/proxy/lifecycle-method.test.js | 5 +++++ test/reconciler.test.js | 4 ++++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/AppContainer.dev.js b/src/AppContainer.dev.js index e5c83fff8..2193b5f88 100644 --- a/src/AppContainer.dev.js +++ b/src/AppContainer.dev.js @@ -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) { diff --git a/test/AppContainer.dev.test.js b/test/AppContainer.dev.test.js index aec9991ad..4bf6f8662 100644 --- a/test/AppContainer.dev.test.js +++ b/test/AppContainer.dev.test.js @@ -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' @@ -18,6 +19,7 @@ import configuration from '../src/configuration' describe(`AppContainer (dev)`, () => { beforeEach(() => { RHL.reset() + configureGeneration(1, 1) }) describe('with class root', () => { diff --git a/test/proxy/consistency.test.js b/test/proxy/consistency.test.js index 70bddc298..61a1cd42c 100644 --- a/test/proxy/consistency.test.js +++ b/test/proxy/consistency.test.js @@ -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: { @@ -68,6 +69,9 @@ const createFixtures = () => ({ }) describe('consistency', () => { + beforeEach(() => { + configureGeneration(1, 1) + }) ensureNoWarnings() const { mount } = createMounter() diff --git a/test/proxy/lifecycle-method.test.js b/test/proxy/lifecycle-method.test.js index ded6bbcfe..b519758c2 100644 --- a/test/proxy/lifecycle-method.test.js +++ b/test/proxy/lifecycle-method.test.js @@ -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 { diff --git a/test/reconciler.test.js b/test/reconciler.test.js index 9760e189f..c0a43399e 100644 --- a/test/reconciler.test.js +++ b/test/reconciler.test.js @@ -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 }) =>
{children}
,