Skip to content

Commit 0b5a26a

Browse files
authored
Rename toWarnDev -> toErrorDev, toLowPriorityWarnDev -> toWarnDev (#17605)
* Rename toWarnDev -> toErrorDev in tests * Rename toWarnDev matcher implementation to toErrorDev * Rename toLowPriorityWarnDev -> toWarnDev in tests and implementation
1 parent 0cf22a5 commit 0b5a26a

File tree

97 files changed

+766
-776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+766
-776
lines changed

packages/create-subscription/src/__tests__/createSubscription-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ describe('createSubscription', () => {
452452
},
453453
() => null,
454454
);
455-
}).toWarnDev('Subscription must specify a getCurrentValue function', {
455+
}).toErrorDev('Subscription must specify a getCurrentValue function', {
456456
withoutStack: true,
457457
});
458458
});
@@ -465,7 +465,7 @@ describe('createSubscription', () => {
465465
},
466466
() => null,
467467
);
468-
}).toWarnDev('Subscription must specify a subscribe function', {
468+
}).toErrorDev('Subscription must specify a subscribe function', {
469469
withoutStack: true,
470470
});
471471
});

packages/react-art/src/__tests__/ReactART-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ describe('ReactARTComponents', () => {
420420
ReactTestRenderer.create(
421421
<Circle stroke="green" strokeWidth={3} fill="blue" />,
422422
),
423-
).toWarnDev(
423+
).toErrorDev(
424424
'Warning: Failed prop type: The prop `radius` is marked as required in `Circle`, ' +
425425
'but its value is `undefined`.' +
426426
'\n in Circle (at **)',
@@ -437,7 +437,7 @@ describe('ReactARTComponents', () => {
437437
it('should warn if width/height is missing on a Rectangle component', () => {
438438
expect(() =>
439439
ReactTestRenderer.create(<Rectangle stroke="green" fill="blue" />),
440-
).toWarnDev([
440+
).toErrorDev([
441441
'Warning: Failed prop type: The prop `width` is marked as required in `Rectangle`, ' +
442442
'but its value is `undefined`.' +
443443
'\n in Rectangle (at **)',
@@ -462,7 +462,7 @@ describe('ReactARTComponents', () => {
462462
});
463463

464464
it('should warn if outerRadius/startAngle/endAngle is missing on a Wedge component', () => {
465-
expect(() => ReactTestRenderer.create(<Wedge fill="blue" />)).toWarnDev([
465+
expect(() => ReactTestRenderer.create(<Wedge fill="blue" />)).toErrorDev([
466466
'Warning: Failed prop type: The prop `outerRadius` is marked as required in `Wedge`, ' +
467467
'but its value is `undefined`.' +
468468
'\n in Wedge (at **)',

packages/react-cache/src/__tests__/ReactCache-test.internal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe('ReactCache', () => {
172172
if (__DEV__) {
173173
expect(() => {
174174
expect(Scheduler).toFlushAndYield(['App', 'Loading...']);
175-
}).toWarnDev([
175+
}).toErrorDev([
176176
'Invalid key type. Expected a string, number, symbol, or ' +
177177
'boolean, but instead received: Hi,100\n\n' +
178178
'To use non-primitive values as keys, you must pass a hash ' +

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('CSSPropertyOperations', () => {
9898

9999
const root = document.createElement('div');
100100

101-
expect(() => ReactDOM.render(<Comp />, root)).toWarnDev(
101+
expect(() => ReactDOM.render(<Comp />, root)).toErrorDev(
102102
'Warning: Unsupported style property background-color. Did you mean backgroundColor?' +
103103
'\n in div (at **)' +
104104
'\n in Comp (at **)',
@@ -121,7 +121,7 @@ describe('CSSPropertyOperations', () => {
121121
const root = document.createElement('div');
122122
ReactDOM.render(<Comp />, root);
123123

124-
expect(() => ReactDOM.render(<Comp style={styles} />, root)).toWarnDev([
124+
expect(() => ReactDOM.render(<Comp style={styles} />, root)).toErrorDev([
125125
'Warning: Unsupported style property -ms-transform. Did you mean msTransform?' +
126126
'\n in div (at **)' +
127127
'\n in Comp (at **)',
@@ -150,7 +150,7 @@ describe('CSSPropertyOperations', () => {
150150

151151
const root = document.createElement('div');
152152

153-
expect(() => ReactDOM.render(<Comp />, root)).toWarnDev([
153+
expect(() => ReactDOM.render(<Comp />, root)).toErrorDev([
154154
// msTransform is correct already and shouldn't warn
155155
'Warning: Unsupported vendor-prefixed style property oTransform. ' +
156156
'Did you mean OTransform?' +
@@ -183,7 +183,7 @@ describe('CSSPropertyOperations', () => {
183183

184184
const root = document.createElement('div');
185185

186-
expect(() => ReactDOM.render(<Comp />, root)).toWarnDev([
186+
expect(() => ReactDOM.render(<Comp />, root)).toErrorDev([
187187
"Warning: Style property values shouldn't contain a semicolon. " +
188188
'Try "backgroundColor: blue" instead.' +
189189
'\n in div (at **)' +
@@ -206,7 +206,7 @@ describe('CSSPropertyOperations', () => {
206206

207207
const root = document.createElement('div');
208208

209-
expect(() => ReactDOM.render(<Comp />, root)).toWarnDev(
209+
expect(() => ReactDOM.render(<Comp />, root)).toErrorDev(
210210
'Warning: `NaN` is an invalid value for the `fontSize` css style property.' +
211211
'\n in div (at **)' +
212212
'\n in Comp (at **)',
@@ -235,7 +235,7 @@ describe('CSSPropertyOperations', () => {
235235

236236
const root = document.createElement('div');
237237

238-
expect(() => ReactDOM.render(<Comp />, root)).toWarnDev(
238+
expect(() => ReactDOM.render(<Comp />, root)).toErrorDev(
239239
'Warning: `Infinity` is an invalid value for the `fontSize` css style property.' +
240240
'\n in div (at **)' +
241241
'\n in Comp (at **)',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe('DOMPropertyOperations', () => {
183183
<input type="text" onChange={function() {}} />,
184184
container,
185185
),
186-
).toWarnDev(
186+
).toErrorDev(
187187
'A component is changing a controlled input of type text to be uncontrolled',
188188
);
189189
if (disableInputAttributeSyncing) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('EventPluginHub', () => {
2727
node = ReactTestUtils.renderIntoDocument(
2828
<div onClick="not a function" />,
2929
);
30-
}).toWarnDev(
30+
}).toErrorDev(
3131
'Expected `onClick` listener to be a function, instead got a value of `string` type.',
3232
);
3333
expect(() => ReactTestUtils.SimulateNative.click(node)).toThrowError(

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('ReactChildReconciler', () => {
6565
<h1>{iterableFunction}</h1>
6666
</div>,
6767
);
68-
}).toWarnDev('Functions are not valid as a React child');
68+
}).toErrorDev('Functions are not valid as a React child');
6969

7070
expect(node.innerHTML).toContain(''); // h1
7171
});
@@ -77,7 +77,7 @@ describe('ReactChildReconciler', () => {
7777
}
7878
}
7979

80-
expect(() => ReactTestUtils.renderIntoDocument(<Component />)).toWarnDev(
80+
expect(() => ReactTestUtils.renderIntoDocument(<Component />)).toErrorDev(
8181
'Keys should be unique so that components maintain their identity ' +
8282
'across updates. Non-unique keys may cause children to be ' +
8383
'duplicated and/or omitted — the behavior is unsupported and ' +
@@ -104,7 +104,7 @@ describe('ReactChildReconciler', () => {
104104
}
105105
}
106106

107-
expect(() => ReactTestUtils.renderIntoDocument(<GrandParent />)).toWarnDev(
107+
expect(() => ReactTestUtils.renderIntoDocument(<GrandParent />)).toErrorDev(
108108
'Encountered two children with the same key, `1`. ' +
109109
'Keys should be unique so that components maintain their identity ' +
110110
'across updates. Non-unique keys may cause children to be ' +
@@ -124,7 +124,7 @@ describe('ReactChildReconciler', () => {
124124
}
125125
}
126126

127-
expect(() => ReactTestUtils.renderIntoDocument(<Component />)).toWarnDev(
127+
expect(() => ReactTestUtils.renderIntoDocument(<Component />)).toErrorDev(
128128
'Keys should be unique so that components maintain their identity ' +
129129
'across updates. Non-unique keys may cause children to be ' +
130130
'duplicated and/or omitted — the behavior is unsupported and ' +
@@ -151,7 +151,7 @@ describe('ReactChildReconciler', () => {
151151
}
152152
}
153153

154-
expect(() => ReactTestUtils.renderIntoDocument(<GrandParent />)).toWarnDev(
154+
expect(() => ReactTestUtils.renderIntoDocument(<GrandParent />)).toErrorDev(
155155
'Encountered two children with the same key, `1`. ' +
156156
'Keys should be unique so that components maintain their identity ' +
157157
'across updates. Non-unique keys may cause children to be ' +

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ describe('ReactComponent', () => {
397397
it('throws usefully when rendering badly-typed elements', () => {
398398
const X = undefined;
399399
expect(() => {
400-
expect(() => ReactTestUtils.renderIntoDocument(<X />)).toWarnDev(
400+
expect(() => ReactTestUtils.renderIntoDocument(<X />)).toErrorDev(
401401
'React.createElement: type is invalid -- expected a string (for built-in components) ' +
402402
'or a class/function (for composite components) but got: undefined.',
403403
);
@@ -412,7 +412,7 @@ describe('ReactComponent', () => {
412412

413413
const Y = null;
414414
expect(() => {
415-
expect(() => ReactTestUtils.renderIntoDocument(<Y />)).toWarnDev(
415+
expect(() => ReactTestUtils.renderIntoDocument(<Y />)).toErrorDev(
416416
'React.createElement: type is invalid -- expected a string (for built-in components) ' +
417417
'or a class/function (for composite components) but got: null.',
418418
);
@@ -442,7 +442,7 @@ describe('ReactComponent', () => {
442442
}
443443

444444
expect(() => {
445-
expect(() => ReactTestUtils.renderIntoDocument(<Foo />)).toWarnDev(
445+
expect(() => ReactTestUtils.renderIntoDocument(<Foo />)).toErrorDev(
446446
'React.createElement: type is invalid -- expected a string (for built-in components) ' +
447447
'or a class/function (for composite components) but got: undefined.',
448448
);
@@ -572,7 +572,7 @@ describe('ReactComponent', () => {
572572
return Foo;
573573
}
574574
const container = document.createElement('div');
575-
expect(() => ReactDOM.render(<Foo />, container)).toWarnDev(
575+
expect(() => ReactDOM.render(<Foo />, container)).toErrorDev(
576576
'Warning: Functions are not valid as a React child. This may happen if ' +
577577
'you return a Component instead of <Component /> from render. ' +
578578
'Or maybe you meant to call this function rather than return it.\n' +
@@ -587,7 +587,7 @@ describe('ReactComponent', () => {
587587
}
588588
}
589589
const container = document.createElement('div');
590-
expect(() => ReactDOM.render(<Foo />, container)).toWarnDev(
590+
expect(() => ReactDOM.render(<Foo />, container)).toErrorDev(
591591
'Warning: Functions are not valid as a React child. This may happen if ' +
592592
'you return a Component instead of <Component /> from render. ' +
593593
'Or maybe you meant to call this function rather than return it.\n' +
@@ -604,7 +604,7 @@ describe('ReactComponent', () => {
604604
);
605605
}
606606
const container = document.createElement('div');
607-
expect(() => ReactDOM.render(<Foo />, container)).toWarnDev(
607+
expect(() => ReactDOM.render(<Foo />, container)).toErrorDev(
608608
'Warning: Functions are not valid as a React child. This may happen if ' +
609609
'you return a Component instead of <Component /> from render. ' +
610610
'Or maybe you meant to call this function rather than return it.\n' +
@@ -649,7 +649,7 @@ describe('ReactComponent', () => {
649649
let component;
650650
expect(() => {
651651
component = ReactDOM.render(<Foo />, container);
652-
}).toWarnDev([
652+
}).toErrorDev([
653653
'Warning: Functions are not valid as a React child. This may happen if ' +
654654
'you return a Component instead of <Component /> from render. ' +
655655
'Or maybe you meant to call this function rather than return it.\n' +

0 commit comments

Comments
 (0)