aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package.json2
-rw-r--r--pnpm-lock.yaml10
-rw-r--r--test/locale-imports.spec.ts20
-rw-r--r--test/modules/location.spec.ts6
-rw-r--r--test/modules/string.spec.ts2
5 files changed, 16 insertions, 24 deletions
diff --git a/package.json b/package.json
index bb6d69ce..b4dc736e 100644
--- a/package.json
+++ b/package.json
@@ -112,7 +112,7 @@
"@types/node": "22.14.1",
"@types/sanitize-html": "2.15.0",
"@types/semver": "7.7.0",
- "@types/validator": "13.12.3",
+ "@types/validator": "13.15.0",
"@vitest/coverage-v8": "3.1.1",
"@vitest/eslint-plugin": "1.1.42",
"@vitest/ui": "3.1.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 42a15065..8201151b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -27,8 +27,8 @@ importers:
specifier: 7.7.0
version: 7.7.0
'@types/validator':
- specifier: 13.12.3
- version: 13.12.3
+ specifier: 13.15.0
+ version: 13.15.0
'@vitest/coverage-v8':
specifier: 3.1.1
version: 3.1.1([email protected])
@@ -892,8 +892,8 @@ packages:
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
- '@types/[email protected]':
- resolution: {integrity: sha512-2ipwZ2NydGQJImne+FhNdhgRM37e9lCev99KnqkbFHd94Xn/mErARWI1RSLem1QA19ch5kOhzIZd7e8CA2FI8g==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-nh7nrWhLr6CBq9ldtw0wx+z9wKnnv/uTVLA9g/3/TcOYxbpOSZE+MhKPmWqU+K0NvThjhv12uD8MuqijB0WzEA==}
resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==}
@@ -4340,7 +4340,7 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
+ '@types/[email protected]': {}
'@types/[email protected]': {}
diff --git a/test/locale-imports.spec.ts b/test/locale-imports.spec.ts
index d516c31d..71d73ec0 100644
--- a/test/locale-imports.spec.ts
+++ b/test/locale-imports.spec.ts
@@ -1,3 +1,4 @@
+import isISO15924 from 'validator/lib/isISO15924';
import { describe, expect, it } from 'vitest';
import type { Faker } from '../src';
import { allLocales } from '../src';
@@ -43,24 +44,7 @@ describe.each(keys(allLocales))('locale imports', (locale) => {
expect(metadata.language).toBeTypeOf('string');
expect(metadata.language).toMatch(/^[a-z]{2}$/);
expect(metadata.script).toBeTypeOf('string');
- expect([
- 'Arab',
- 'Armn',
- 'Beng',
- 'Cyrl',
- 'Deva',
- 'Geor',
- 'Grek',
- 'Hans',
- 'Hant',
- 'Hebr',
- 'Jpan',
- 'Kore',
- 'Latn',
- 'Taml',
- 'Thaa',
- 'Thai',
- ]).toContain(metadata.script);
+ expect(metadata.script).toSatisfy(isISO15924);
expect(metadata.endonym).toBeTypeOf('string');
expect(metadata.dir).toBeTypeOf('string');
expect(['ltr', 'rtl']).toContain(metadata.dir);
diff --git a/test/modules/location.spec.ts b/test/modules/location.spec.ts
index 8af00f37..45d789a4 100644
--- a/test/modules/location.spec.ts
+++ b/test/modules/location.spec.ts
@@ -1,3 +1,6 @@
+import isISO31661Alpha2 from 'validator/lib/isISO31661Alpha2';
+import isISO31661Alpha3 from 'validator/lib/isISO31661Alpha3';
+import isISO31661Numeric from 'validator/lib/isISO31661Numeric';
import { describe, expect, it } from 'vitest';
import {
FakerError,
@@ -165,6 +168,7 @@ describe('location', () => {
expect(countryCode).toBeTruthy();
expect(countryCode).toMatch(/^[A-Z]{2}$/);
+ expect(countryCode).toSatisfy(isISO31661Alpha2);
});
it('returns random alpha-3 countryCode', () => {
@@ -172,6 +176,7 @@ describe('location', () => {
expect(countryCode).toBeTruthy();
expect(countryCode).toMatch(/^[A-Z]{3}$/);
+ expect(countryCode).toSatisfy(isISO31661Alpha3);
});
it('returns random numeric countryCode', () => {
@@ -179,6 +184,7 @@ describe('location', () => {
expect(countryCode).toBeTruthy();
expect(countryCode).toMatch(/^\d{3}$/);
+ expect(countryCode).toSatisfy(isISO31661Numeric);
});
});
diff --git a/test/modules/string.spec.ts b/test/modules/string.spec.ts
index 7b3be347..3dc8a255 100644
--- a/test/modules/string.spec.ts
+++ b/test/modules/string.spec.ts
@@ -1,3 +1,4 @@
+import isULID from 'validator/lib/isULID';
import { describe, expect, it } from 'vitest';
import { FakerError, faker } from '../../src';
import { seededTests } from '../support/seeded-runs';
@@ -774,6 +775,7 @@ describe('string', () => {
const ulid = faker.string.ulid();
const regex = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;
expect(ulid).toMatch(regex);
+ expect(ulid).toSatisfy(isULID);
});
});