9
9
10
10
'use strict' ;
11
11
12
- describe ( 'PropTypesProductionStandalone' , function ( ) {
12
+ describe ( 'PropTypesProductionStandalone' , ( ) => {
13
13
let React ;
14
14
let PropTypes ;
15
15
@@ -21,11 +21,11 @@ describe('PropTypesProductionStandalone', function() {
21
21
PropTypes = require ( '../index' ) ;
22
22
}
23
23
24
- beforeEach ( function ( ) {
24
+ beforeEach ( ( ) => {
25
25
resetWarningCache ( ) ;
26
26
} ) ;
27
27
28
- afterEach ( function ( ) {
28
+ afterEach ( ( ) => {
29
29
delete process . env . NODE_ENV ;
30
30
} ) ;
31
31
@@ -70,8 +70,8 @@ describe('PropTypesProductionStandalone', function() {
70
70
expect ( message ) . toBe ( null ) ;
71
71
}
72
72
73
- describe ( 'Primitive Types' , function ( ) {
74
- it ( 'should be a no-op' , function ( ) {
73
+ describe ( 'Primitive Types' , ( ) => {
74
+ it ( 'should be a no-op' , ( ) => {
75
75
expectThrowsInProduction ( PropTypes . array , / p l e a s e / ) ;
76
76
expectThrowsInProduction ( PropTypes . array . isRequired , / p l e a s e / ) ;
77
77
expectThrowsInProduction ( PropTypes . array . isRequired , null ) ;
@@ -112,16 +112,16 @@ describe('PropTypesProductionStandalone', function() {
112
112
} ) ;
113
113
} ) ;
114
114
115
- describe ( 'Any Type' , function ( ) {
116
- it ( 'should be a no-op' , function ( ) {
115
+ describe ( 'Any Type' , ( ) => {
116
+ it ( 'should be a no-op' , ( ) => {
117
117
expectThrowsInProduction ( PropTypes . any , null ) ;
118
118
expectThrowsInProduction ( PropTypes . any . isRequired , null ) ;
119
119
expectThrowsInProduction ( PropTypes . any . isRequired , undefined ) ;
120
120
} ) ;
121
121
} ) ;
122
122
123
- describe ( 'ArrayOf Type' , function ( ) {
124
- it ( 'should be a no-op' , function ( ) {
123
+ describe ( 'ArrayOf Type' , ( ) => {
124
+ it ( 'should be a no-op' , ( ) => {
125
125
expectThrowsInProduction ( PropTypes . arrayOf ( { foo : PropTypes . string } ) , {
126
126
foo : 'bar' ,
127
127
} ) ;
@@ -145,8 +145,8 @@ describe('PropTypesProductionStandalone', function() {
145
145
} ) ;
146
146
} ) ;
147
147
148
- describe ( 'Component Type' , function ( ) {
149
- it ( 'should be a no-op' , function ( ) {
148
+ describe ( 'Component Type' , ( ) => {
149
+ it ( 'should be a no-op' , ( ) => {
150
150
expectThrowsInProduction ( PropTypes . element , [ < div /> , < div /> ] ) ;
151
151
expectThrowsInProduction ( PropTypes . element , 123 ) ;
152
152
if ( typeof BigInt === 'function' ) {
@@ -159,30 +159,30 @@ describe('PropTypesProductionStandalone', function() {
159
159
} ) ;
160
160
} ) ;
161
161
162
- describe ( 'Instance Types' , function ( ) {
163
- it ( 'should be a no-op' , function ( ) {
162
+ describe ( 'Instance Types' , ( ) => {
163
+ it ( 'should be a no-op' , ( ) => {
164
164
expectThrowsInProduction ( PropTypes . instanceOf ( Date ) , { } ) ;
165
165
expectThrowsInProduction ( PropTypes . instanceOf ( Date ) . isRequired , { } ) ;
166
166
} ) ;
167
167
} ) ;
168
168
169
- describe ( 'React Component Types' , function ( ) {
170
- it ( 'should be a no-op' , function ( ) {
169
+ describe ( 'React Component Types' , ( ) => {
170
+ it ( 'should be a no-op' , ( ) => {
171
171
expectThrowsInProduction ( PropTypes . node , { } ) ;
172
172
expectThrowsInProduction ( PropTypes . node . isRequired , null ) ;
173
173
expectThrowsInProduction ( PropTypes . node . isRequired , undefined ) ;
174
174
} ) ;
175
175
} ) ;
176
176
177
- describe ( 'React ElementType Type' , function ( ) {
178
- it ( 'should be a no-op' , function ( ) {
177
+ describe ( 'React ElementType Type' , ( ) => {
178
+ it ( 'should be a no-op' , ( ) => {
179
179
expectThrowsInProduction ( PropTypes . elementType . isRequired , false ) ;
180
180
expectThrowsInProduction ( PropTypes . elementType . isRequired , { } ) ;
181
181
} ) ;
182
182
} ) ;
183
183
184
- describe ( 'ObjectOf Type' , function ( ) {
185
- it ( 'should be a no-op' , function ( ) {
184
+ describe ( 'ObjectOf Type' , ( ) => {
185
+ it ( 'should be a no-op' , ( ) => {
186
186
expectThrowsInProduction ( PropTypes . objectOf ( { foo : PropTypes . string } ) , {
187
187
foo : 'bar' ,
188
188
} ) ;
@@ -197,17 +197,17 @@ describe('PropTypesProductionStandalone', function() {
197
197
} ) ;
198
198
} ) ;
199
199
200
- describe ( 'OneOf Types' , function ( ) {
201
- it ( 'should be a no-op' , function ( ) {
200
+ describe ( 'OneOf Types' , ( ) => {
201
+ it ( 'should be a no-op' , ( ) => {
202
202
expectThrowsInProduction ( PropTypes . oneOf ( 'red' , 'blue' ) , 'red' ) ;
203
203
expectThrowsInProduction ( PropTypes . oneOf ( [ 'red' , 'blue' ] ) , true ) ;
204
204
expectThrowsInProduction ( PropTypes . oneOf ( [ 'red' , 'blue' ] ) , null ) ;
205
205
expectThrowsInProduction ( PropTypes . oneOf ( [ 'red' , 'blue' ] ) , undefined ) ;
206
206
} ) ;
207
207
} ) ;
208
208
209
- describe ( 'Union Types' , function ( ) {
210
- it ( 'should be a no-op' , function ( ) {
209
+ describe ( 'Union Types' , ( ) => {
210
+ it ( 'should be a no-op' , ( ) => {
211
211
expectThrowsInProduction (
212
212
PropTypes . oneOfType ( PropTypes . string , PropTypes . number ) ,
213
213
'red' ,
@@ -227,8 +227,8 @@ describe('PropTypesProductionStandalone', function() {
227
227
} ) ;
228
228
} ) ;
229
229
230
- describe ( 'Shape Types' , function ( ) {
231
- it ( 'should be a no-op' , function ( ) {
230
+ describe ( 'Shape Types' , ( ) => {
231
+ it ( 'should be a no-op' , ( ) => {
232
232
expectThrowsInProduction ( PropTypes . shape ( { } ) , 'some string' ) ;
233
233
expectThrowsInProduction (
234
234
PropTypes . shape ( { key : PropTypes . number } ) . isRequired ,
@@ -241,8 +241,8 @@ describe('PropTypesProductionStandalone', function() {
241
241
} ) ;
242
242
} ) ;
243
243
244
- describe ( 'checkPropTypes' , function ( ) {
245
- it ( 'does not call validators' , function ( ) {
244
+ describe ( 'checkPropTypes' , ( ) => {
245
+ it ( 'does not call validators' , ( ) => {
246
246
spyOn ( console , 'error' ) ;
247
247
248
248
const spy = jest . fn ( ) ;
0 commit comments