Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve internet tests #1045

Merged
merged 5 commits into from
Jun 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/internet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const seededRuns = [
},
];

const NON_SEEDED_BASED_RUN = 500;
const NON_SEEDED_BASED_RUN = 5;

const functionNames = [
'avatar',
Expand Down Expand Up @@ -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\(.*\)*))*)$/
);
});
});

Expand All @@ -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();
Expand Down