@@ -4,18 +4,33 @@ import { describeInput } from '../src/describeInput.js';
44
55describe ( 'describeInput()' , ( ) => {
66 it ( 'Returns a string describing the input' , ( ) => {
7+ expect ( describeInput ( true ) ) . toBe ( 'true' ) ;
8+ expect ( describeInput ( false ) ) . toBe ( 'false' ) ;
79 expect ( describeInput ( { } ) ) . toBe ( 'Object' ) ;
8- expect ( describeInput ( Infinity ) ) . toBe ( 'Infinity' ) ;
10+ expect ( describeInput ( [ ] ) ) . toBe ( 'Array' ) ;
11+ expect ( describeInput ( new Set ( ) ) ) . toBe ( 'Set' ) ;
12+ expect ( describeInput ( ( ) => { } ) ) . toBe ( 'anonymous()' ) ;
13+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14+ expect ( describeInput ( function namedFunction ( _name : unknown ) { } ) ) . toBe ( 'namedFunction(_name)' ) ;
15+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16+ expect ( describeInput ( function ( _name : unknown ) { } ) ) . toBe ( 'anonymous(_name)' ) ;
17+ expect ( describeInput ( Infinity ) ) . toBe ( 'Positive Infinity' ) ;
18+ expect ( describeInput ( Number . POSITIVE_INFINITY ) ) . toBe ( 'Positive Infinity' ) ;
919 expect ( describeInput ( - Infinity ) ) . toBe ( 'Negative Infinity' ) ;
10- expect ( describeInput ( 1 ) ) . toBe ( 'Integer' ) ;
11- expect ( describeInput ( 1.2 ) ) . toBe ( 'Number' ) ;
20+ expect ( describeInput ( Number . NEGATIVE_INFINITY ) ) . toBe ( 'Negative Infinity' ) ;
21+ expect ( describeInput ( - 1 ) ) . toBe ( 'Safe Integer' ) ;
22+ expect ( describeInput ( 2 ** 52 ) ) . toBe ( 'Safe Integer' ) ;
23+ expect ( describeInput ( 2 ** 53 ) ) . toBe ( 'Integer' ) ;
24+ expect ( describeInput ( 1.2 ) ) . toBe ( 'Finite Number' ) ;
1225 expect ( describeInput ( Number . NaN ) ) . toBe ( 'NaN' ) ;
1326 expect ( describeInput ( '123' ) ) . toBe ( 'Numeric String' ) ;
14- expect ( describeInput ( 'Basic TOKEN' ) ) . toBe ( 'Basic' ) ;
15- expect ( describeInput ( 'Bearer TOKEN' ) ) . toBe ( 'Bearer' ) ;
27+ expect ( describeInput ( 'Basic TOKEN' ) ) . toBe ( 'Basic Authorization ' ) ;
28+ expect ( describeInput ( 'Bearer TOKEN' ) ) . toBe ( 'Bearer Authorization ' ) ;
1629 expect ( describeInput ( 'ftp://example.com/' ) ) . toContain ( 'URL' ) ;
1730 expect ( describeInput ( 'https://user:[email protected] /' ) ) . toContain ( 'credentials' ) ; 1831 expect ( describeInput ( 'https:///' ) ) . toBe ( 'Invalid URL' ) ;
1932 expect ( describeInput ( 'Test' ) ) . toBe ( 'String' ) ;
33+ expect ( describeInput ( Symbol ( ) ) ) . toBe ( 'Symbol()' ) ;
34+ expect ( describeInput ( Symbol ( 'test' ) ) ) . toBe ( 'Symbol(test)' ) ;
2035 } ) ;
2136} ) ;
0 commit comments