@@ -325,6 +325,9 @@ describe('PropTypesDevelopmentStandalone', () => {
325325
326326 it ( 'should not warn for valid values' , ( ) => {
327327 typeCheckPass ( PropTypes . array , [ ] ) ;
328+ if ( typeof BigInt === 'function' ) {
329+ typeCheckPass ( PropTypes . bigint , BigInt ( 0 ) ) ;
330+ }
328331 typeCheckPass ( PropTypes . bool , false ) ;
329332 typeCheckPass ( PropTypes . func , function ( ) { } ) ;
330333 typeCheckPass ( PropTypes . number , 0 ) ;
@@ -345,6 +348,7 @@ describe('PropTypesDevelopmentStandalone', () => {
345348 typeCheckFailRequiredValues ( PropTypes . array . isRequired ) ;
346349 typeCheckFailRequiredValues ( PropTypes . symbol . isRequired ) ;
347350 typeCheckFailRequiredValues ( PropTypes . number . isRequired ) ;
351+ typeCheckFailRequiredValues ( PropTypes . bigint . isRequired ) ;
348352 typeCheckFailRequiredValues ( PropTypes . bool . isRequired ) ;
349353 typeCheckFailRequiredValues ( PropTypes . func . isRequired ) ;
350354 typeCheckFailRequiredValues ( PropTypes . shape ( { } ) . isRequired ) ;
@@ -358,6 +362,15 @@ describe('PropTypesDevelopmentStandalone', () => {
358362 expectThrowsInDevelopment ( PropTypes . array . isRequired , [ ] ) ;
359363 expectThrowsInDevelopment ( PropTypes . array . isRequired , null ) ;
360364 expectThrowsInDevelopment ( PropTypes . array . isRequired , undefined ) ;
365+ expectThrowsInDevelopment ( PropTypes . bigint , function ( ) { } ) ;
366+ expectThrowsInDevelopment ( PropTypes . bigint , 42 ) ;
367+ if ( typeof BigInt === 'function' ) {
368+ expectThrowsInDevelopment ( PropTypes . bigint , BigInt ( 42 ) ) ;
369+ }
370+ expectThrowsInDevelopment ( PropTypes . bigint . isRequired , function ( ) { } ) ;
371+ expectThrowsInDevelopment ( PropTypes . bigint . isRequired , 42 ) ;
372+ expectThrowsInDevelopment ( PropTypes . bigint . isRequired , null ) ;
373+ expectThrowsInDevelopment ( PropTypes . bigint . isRequired , undefined ) ;
361374 expectThrowsInDevelopment ( PropTypes . bool , [ ] ) ;
362375 expectThrowsInDevelopment ( PropTypes . bool , true ) ;
363376 expectThrowsInDevelopment ( PropTypes . bool . isRequired , [ ] ) ;
@@ -433,6 +446,9 @@ describe('PropTypesDevelopmentStandalone', () => {
433446
434447 it ( 'should support the arrayOf propTypes' , ( ) => {
435448 typeCheckPass ( PropTypes . arrayOf ( PropTypes . number ) , [ 1 , 2 , 3 ] ) ;
449+ if ( typeof BigInt === 'function' ) {
450+ typeCheckPass ( PropTypes . arrayOf ( PropTypes . bigint ) , [ BigInt ( 1 ) , BigInt ( 2 ) , BigInt ( 3 ) ] ) ;
451+ }
436452 typeCheckPass ( PropTypes . arrayOf ( PropTypes . string ) , [ 'a' , 'b' , 'c' ] ) ;
437453 typeCheckPass ( PropTypes . arrayOf ( PropTypes . oneOf ( [ 'a' , 'b' ] ) ) , [ 'a' , 'b' ] ) ;
438454 typeCheckPass ( PropTypes . arrayOf ( PropTypes . symbol ) , [ Symbol ( ) , Symbol ( ) ] ) ;
@@ -536,7 +552,6 @@ describe('PropTypesDevelopmentStandalone', () => {
536552 } ) ;
537553
538554 describe ( 'Component Type' , ( ) => {
539-
540555 it ( 'should support components' , ( ) => {
541556 typeCheckPass ( PropTypes . element , < div /> ) ;
542557 } ) ;
@@ -554,6 +569,14 @@ describe('PropTypesDevelopmentStandalone', () => {
554569 'Invalid prop `testProp` of type `number` supplied to `testComponent`, ' +
555570 'expected a single ReactElement.' ,
556571 ) ;
572+ if ( typeof BigInt === 'function' ) {
573+ typeCheckFail (
574+ PropTypes . element ,
575+ BigInt ( 123 ) ,
576+ 'Invalid prop `testProp` of type `bigint` supplied to `testComponent`, ' +
577+ 'expected a single ReactElement.' ,
578+ ) ;
579+ }
557580 typeCheckFail (
558581 PropTypes . element ,
559582 'foo' ,
0 commit comments