From 26f89ea6013cda78fbd615fe7e44eedea2514b48 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Fri, 10 Jun 2022 08:42:46 +0200 Subject: test: improve internet tests (#1045) Co-authored-by: xDivisionByZerox --- test/internet.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/internet.spec.ts b/test/internet.spec.ts index 313be914..1160538d 100644 --- a/test/internet.spec.ts +++ b/test/internet.spec.ts @@ -84,7 +84,7 @@ const seededRuns = [ }, ]; -const NON_SEEDED_BASED_RUN = 500; +const NON_SEEDED_BASED_RUN = 5; const functionNames = [ 'avatar', @@ -477,7 +477,10 @@ describe('internet', () => { expect(ua).toBeTruthy(); expect(ua).toBeTypeOf('string'); - // TODO @Shinigami92 2022-02-11: Make tests more strict + expect(ua.length).toBeGreaterThanOrEqual(1); + expect(ua).toMatch( + /^(([^\d]+\/[\dA-Za-z\.]+(\s\(.*\)))|([^\d]+\/[\dA-Za-z\.]+(\s\(.*\)*))(\s[^\d]+\/[\dA-Za-z\.]+(\s\(.*\)*))*)$/ + ); }); }); @@ -491,7 +494,6 @@ describe('internet', () => { }); it('should return a random hex value with given values', () => { - // TODO @Shinigami92 2022-02-11: Understand what's going on const color = faker.internet.color(100, 100, 100); expect(color).toBeTruthy(); -- cgit v1.2.3