diff options
Diffstat (limited to 'test/modules')
| -rw-r--r-- | test/modules/__snapshots__/location.spec.ts.snap | 24 | ||||
| -rw-r--r-- | test/modules/location.spec.ts | 15 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/modules/__snapshots__/location.spec.ts.snap b/test/modules/__snapshots__/location.spec.ts.snap index a8d24e9a..6116943f 100644 --- a/test/modules/__snapshots__/location.spec.ts.snap +++ b/test/modules/__snapshots__/location.spec.ts.snap @@ -32,6 +32,14 @@ exports[`location > 42 > direction > noArgs 1`] = `"South"`; exports[`location > 42 > direction > with abbreviated option 1`] = `"S"`; +exports[`location > 42 > language 1`] = ` +{ + "alpha2": "gu", + "alpha3": "guj", + "name": "Gujarati", +} +`; + exports[`location > 42 > latitude > noArgs 1`] = `-22.5828`; exports[`location > 42 > latitude > with max and min option 1`] = `-2.5092`; @@ -170,6 +178,14 @@ exports[`location > 1211 > direction > noArgs 1`] = `"Southwest"`; exports[`location > 1211 > direction > with abbreviated option 1`] = `"SW"`; +exports[`location > 1211 > language 1`] = ` +{ + "alpha2": "tl", + "alpha3": "tgl", + "name": "Tagalog", +} +`; + exports[`location > 1211 > latitude > noArgs 1`] = `77.1337`; exports[`location > 1211 > latitude > with max and min option 1`] = `8.5704`; @@ -308,6 +324,14 @@ exports[`location > 1337 > direction > noArgs 1`] = `"South"`; exports[`location > 1337 > direction > with abbreviated option 1`] = `"S"`; +exports[`location > 1337 > language 1`] = ` +{ + "alpha2": "ru", + "alpha3": "rus", + "name": "Russian", +} +`; + exports[`location > 1337 > latitude > noArgs 1`] = `-42.8356`; exports[`location > 1337 > latitude > with max and min option 1`] = `-4.7595`; diff --git a/test/modules/location.spec.ts b/test/modules/location.spec.ts index 2be7c489..78b68812 100644 --- a/test/modules/location.spec.ts +++ b/test/modules/location.spec.ts @@ -126,6 +126,8 @@ describe('location', () => { t.it('timeZone'); + t.it('language'); + t.describeEach( 'direction', 'cardinalDirection', @@ -415,6 +417,19 @@ describe('location', () => { expect(faker.definitions.location.time_zone).toContain(actual); }); }); + + describe('language()', () => { + it('should return a random language', () => { + const actual = faker.location.language(); + expect(actual.name).toBeTruthy(); + expect(actual.alpha2).toBeTruthy(); + expect(actual.alpha2).toHaveLength(2); + expect(actual.alpha3).toBeTruthy(); + expect(actual.alpha3).toHaveLength(3); + + expect(faker.definitions.location.language).toContain(actual); + }); + }); } ); }); |
