diff --git a/test/validators.test.js b/test/validators.test.js index ec8154e49..435868891 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -496,9 +496,11 @@ describe('Validators', () => { }], valid: [ 'rtmp://foobar.com', + 'rtmp:foobar.com', ], invalid: [ 'http://foobar.com', + 'tel:+15551234567', ], }); }); @@ -722,6 +724,21 @@ describe('Validators', () => { }); }); + it('should validate authentication strings if a protocol is not required', () => { + test({ + validator: 'isURL', + args: [{ + require_protocol: false, + }], + valid: [ + 'user:pw@foobar.com/', + ], + invalid: [ + 'user:pw,@foobar.com/', + ], + }); + }); + it('should let users specify a host whitelist', () => { test({ validator: 'isURL',