diff options
| author | ST-DDT <[email protected]> | 2024-11-21 23:10:12 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-21 22:10:12 +0000 |
| commit | 56acea375da20fed64c7d9b5336ad078f4c6782a (patch) | |
| tree | ea2ace1ed72b569b7b461a17837d5ce55962ba04 /test/modules/git.spec.ts | |
| parent | 3e1f26c284f711477fd453c242f9dc3a6ac147e0 (diff) | |
| download | faker-56acea375da20fed64c7d9b5336ad078f4c6782a.tar.xz faker-56acea375da20fed64c7d9b5336ad078f4c6782a.zip | |
chore: import validator functions individually (#3274)
Diffstat (limited to 'test/modules/git.spec.ts')
| -rw-r--r-- | test/modules/git.spec.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/modules/git.spec.ts b/test/modules/git.spec.ts index 164b19c6..07c096e0 100644 --- a/test/modules/git.spec.ts +++ b/test/modules/git.spec.ts @@ -1,4 +1,4 @@ -import validator from 'validator'; +import { isEmail, isHexadecimal, isSlug } from 'validator'; import { describe, expect, it } from 'vitest'; import { faker } from '../../src'; import { seededTests } from '../support/seeded-runs'; @@ -13,7 +13,7 @@ function isValidCommitAuthor(email: string): boolean { // that contain unquoted characters like . output by Git so we need // to quote the display name const quotedEmail = email.replace(/^(.*) </, '"$1" <'); - return validator.isEmail(quotedEmail, { + return isEmail(quotedEmail, { require_display_name: true, }); } @@ -49,7 +49,7 @@ describe('git', () => { expect(branch).toBeTruthy(); expect(branch).toBeTypeOf('string'); - expect(branch).toSatisfy(validator.isSlug); + expect(branch).toSatisfy(isSlug); }); }); @@ -145,7 +145,7 @@ describe('git', () => { expect(commitSha).toBeTruthy(); expect(commitSha).toBeTypeOf('string'); - expect(commitSha).toSatisfy(validator.isHexadecimal); + expect(commitSha).toSatisfy(isHexadecimal); expect(commitSha).toHaveLength(40); }); @@ -159,7 +159,7 @@ describe('git', () => { expect(commitSha).toBeTruthy(); expect(commitSha).toBeTypeOf('string'); - expect(commitSha).toSatisfy(validator.isHexadecimal); + expect(commitSha).toSatisfy(isHexadecimal); expect(commitSha).toHaveLength(length); } ); |
