Skip to content

Commit 6d90c60

Browse files
test(isURL): Add more tests
1 parent d7a67eb commit 6d90c60

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/validators.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,11 @@ describe('Validators', () => {
496496
}],
497497
valid: [
498498
'rtmp://foobar.com',
499+
'rtmp:foobar.com',
499500
],
500501
invalid: [
501502
'http://foobar.com',
503+
'tel:+15551234567',
502504
],
503505
});
504506
});
@@ -722,6 +724,21 @@ describe('Validators', () => {
722724
});
723725
});
724726

727+
it('should validate authentication strings if a protocol is not required', () => {
728+
test({
729+
validator: 'isURL',
730+
args: [{
731+
require_protocol: false,
732+
}],
733+
valid: [
734+
735+
],
736+
invalid: [
737+
'user:pw,@foobar.com/',
738+
],
739+
});
740+
});
741+
725742
it('should let users specify a host whitelist', () => {
726743
test({
727744
validator: 'isURL',

0 commit comments

Comments
 (0)