Skip to content

Commit 24481a2

Browse files
author
Felix Wu
committed
Adapt tests
1 parent d73d3cc commit 24481a2

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ describe('ReactComponentLifeCycle', () => {
10031003

10041004
const div = document.createElement('div');
10051005
expect(() => ReactDOM.render(<MyComponent />, div)).toWarnDev(
1006-
'MyComponent: Did not properly initialize state during construction. ' +
1006+
'MyComponent: Component state must be properly initialized when using getDerivedStateFromProps. ' +
10071007
'Expected state to be an object, but it was undefined.',
10081008
{withoutStack: true},
10091009
);

packages/react-dom/src/__tests__/ReactDOMServerLifecycles-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ describe('ReactDOMServerLifecycles', () => {
201201
}
202202

203203
expect(() => ReactDOMServer.renderToString(<Component />)).toWarnDev(
204-
'Component: Did not properly initialize state during construction. ' +
204+
'Component: Component state must be properly initialized when using getDerivedStateFromProps. ' +
205205
'Expected state to be an object, but it was undefined.',
206206
{withoutStack: true},
207207
);

packages/react/src/__tests__/ReactCoffeeScriptClass-test.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe 'ReactCoffeeScriptClass', ->
163163
}
164164
expect(->
165165
ReactDOM.render(React.createElement(Foo, foo: 'foo'), container)
166-
).toWarnDev 'Foo: Did not properly initialize state during construction. Expected state to be an object, but it was undefined.', {withoutStack: true}
166+
).toWarnDev 'Foo: Component state must be properly initialized when using getDerivedStateFromProps. Expected state to be an object, but it was undefined.', {withoutStack: true}
167167
undefined
168168

169169
it 'updates initial state with values returned by static getDerivedStateFromProps', ->

packages/react/src/__tests__/ReactES6Class-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe('ReactES6Class', () => {
190190
}
191191
}
192192
expect(() => ReactDOM.render(<Foo foo="foo" />, container)).toWarnDev(
193-
'Foo: Did not properly initialize state during construction. ' +
193+
'Foo: Component state must be properly initialized when using getDerivedStateFromProps. ' +
194194
'Expected state to be an object, but it was undefined.',
195195
{withoutStack: true},
196196
);

packages/react/src/__tests__/ReactTypeScriptClass-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ describe('ReactTypeScriptClass', function() {
448448
expect(function() {
449449
ReactDOM.render(React.createElement(Foo, {foo: 'foo'}), container);
450450
}).toWarnDev(
451-
'Foo: Did not properly initialize state during construction. ' +
451+
'Foo: Component state must be properly initialized when using getDerivedStateFromProps. ' +
452452
'Expected state to be an object, but it was undefined.',
453453
{withoutStack: true}
454454
);

packages/react/src/__tests__/createReactClassIntegration-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ describe('create-react-class-integration', () => {
510510
});
511511
expect(() =>
512512
ReactDOM.render(<Component />, document.createElement('div')),
513-
).toWarnDev('Did not properly initialize state during construction.', {
513+
).toWarnDev('Component state must be properly initialized when using getDerivedStateFromProps.', {
514514
withoutStack: true,
515515
});
516516
});

0 commit comments

Comments
 (0)