@@ -12,7 +12,7 @@ describe('Raw Validator', function () {
1212 } ) ;
1313
1414 it ( 'should return false when input is an object' , function ( ) {
15- const isArray = Is . array ( { age : 22 } ) ;
15+ const isArray = Is . array ( { age : 22 } ) ;
1616 expect ( isArray ) . to . equal ( false ) ;
1717 } ) ;
1818
@@ -108,22 +108,22 @@ describe('Raw Validator', function () {
108108 } ) ;
109109
110110 it ( 'should return true when input is an object' , function ( ) {
111- const isObject = Is . object ( { name : 'virk' } ) ;
111+ const isObject = Is . object ( { name : 'virk' } ) ;
112112 expect ( isObject ) . to . equal ( true ) ;
113113 } ) ;
114114
115115 it ( 'should return false when input is not a stringify object' , function ( ) {
116- const isObject = Is . object ( JSON . stringify ( { name : 'virk' } ) ) ;
116+ const isObject = Is . object ( JSON . stringify ( { name : 'virk' } ) ) ;
117117 expect ( isObject ) . to . equal ( false ) ;
118118 } ) ;
119119
120120 it ( 'should return true when input is json' , function ( ) {
121- const isJson = Is . json ( JSON . stringify ( { name : 'virk' } ) ) ;
121+ const isJson = Is . json ( JSON . stringify ( { name : 'virk' } ) ) ;
122122 expect ( isJson ) . to . equal ( true ) ;
123123 } ) ;
124124
125125 it ( 'should return false when input is an object' , function ( ) {
126- const isJson = Is . json ( { name : 'virk' } ) ;
126+ const isJson = Is . json ( { name : 'virk' } ) ;
127127 expect ( isJson ) . to . equal ( false ) ;
128128 } ) ;
129129
@@ -291,6 +291,21 @@ describe('Raw Validator', function () {
291291 expect ( isUrl ) . to . equal ( false ) ;
292292 } ) ;
293293
294+ it ( 'should return true when input contains only localhost' , function ( ) {
295+ const isUrl = Is . url ( 'http://localhost' ) ;
296+ expect ( isUrl ) . to . equal ( true ) ;
297+ } ) ;
298+
299+ it ( 'should return true when input contains localhost with port' , function ( ) {
300+ const isUrl = Is . url ( 'http://localhost:80' ) ;
301+ expect ( isUrl ) . to . equal ( true ) ;
302+ } ) ;
303+
304+ it ( 'should return true when domain name part contains 1 character' , function ( ) {
305+ const isUrl = Is . url ( 'https://t.co' ) ;
306+ expect ( isUrl ) . to . equal ( true ) ;
307+ } ) ;
308+
294309 it ( 'should return false when input is not a valid email' , function ( ) {
295310 const isEmail = Is . email ( 'mail' ) ;
296311 expect ( isEmail ) . to . equal ( false ) ;
0 commit comments