From 3c6c7349c10e2b66a13c31246c8544c241305225 Mon Sep 17 00:00:00 2001 From: Aalekh Patel Date: Tue, 2 May 2023 10:01:27 -0500 Subject: [PATCH 1/2] Add a test that asserts numeric chars in tld are rejected by default. Signed-off-by: Aalekh Patel --- test/validators/isFQDN.test.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/validators/isFQDN.test.js diff --git a/test/validators/isFQDN.test.js b/test/validators/isFQDN.test.js new file mode 100644 index 000000000..04d21cf9c --- /dev/null +++ b/test/validators/isFQDN.test.js @@ -0,0 +1,26 @@ +import test from '../testFunctions'; + +describe('isFQDN', () => { + it('should validate domain names.', () => { + test({ + validator: 'isFQDN', + args: [], + valid: [ + 'google.com', + ], + invalid: [ + 'google.l33t', + ], + }); + test({ + validator: 'isFQDN', + args: [{ allow_numeric_tld: true }], + valid: [ + 'google.com', + 'google.l33t', + ], + invalid: [ + ], + }); + }); +}); \ No newline at end of file From a73ed4685ab75cf735676f69a094aae26699251b Mon Sep 17 00:00:00 2001 From: Aalekh Patel Date: Tue, 2 May 2023 10:43:32 -0500 Subject: [PATCH 2/2] Add a new line at the end. Signed-off-by: Aalekh Patel --- test/validators/isFQDN.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validators/isFQDN.test.js b/test/validators/isFQDN.test.js index 04d21cf9c..134bab005 100644 --- a/test/validators/isFQDN.test.js +++ b/test/validators/isFQDN.test.js @@ -23,4 +23,4 @@ describe('isFQDN', () => { ], }); }); -}); \ No newline at end of file +});