aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJoscha Feth <[email protected]>2024-10-12 14:39:42 +0100
committerGitHub <[email protected]>2024-10-12 15:39:42 +0200
commit4056ab09c64be40d41562284ec64e7531fbaff41 (patch)
treef33217e1fb0d98b52f6076421aaca98757d52aac /test
parent033c23b109de18dcfaf8abeab4e134a47c57b460 (diff)
downloadfaker-4056ab09c64be40d41562284ec64e7531fbaff41.tar.xz
faker-4056ab09c64be40d41562284ec64e7531fbaff41.zip
feat(location): add `continent` method (#3162)
Diffstat (limited to 'test')
-rw-r--r--test/modules/__snapshots__/location.spec.ts.snap6
-rw-r--r--test/modules/location.spec.ts12
2 files changed, 18 insertions, 0 deletions
diff --git a/test/modules/__snapshots__/location.spec.ts.snap b/test/modules/__snapshots__/location.spec.ts.snap
index b53acbda..a8d24e9a 100644
--- a/test/modules/__snapshots__/location.spec.ts.snap
+++ b/test/modules/__snapshots__/location.spec.ts.snap
@@ -8,6 +8,8 @@ exports[`location > 42 > cardinalDirection > with abbreviated option 1`] = `"E"`
exports[`location > 42 > city 1`] = `"Fort Moses"`;
+exports[`location > 42 > continent 1`] = `"Asia"`;
+
exports[`location > 42 > country 1`] = `"Guinea"`;
exports[`location > 42 > countryCode > noArgs 1`] = `"GY"`;
@@ -144,6 +146,8 @@ exports[`location > 1211 > cardinalDirection > with abbreviated option 1`] = `"W
exports[`location > 1211 > city 1`] = `"The Villages"`;
+exports[`location > 1211 > continent 1`] = `"South America"`;
+
exports[`location > 1211 > country 1`] = `"Uganda"`;
exports[`location > 1211 > countryCode > noArgs 1`] = `"UM"`;
@@ -280,6 +284,8 @@ exports[`location > 1337 > cardinalDirection > with abbreviated option 1`] = `"E
exports[`location > 1337 > city 1`] = `"East Duane"`;
+exports[`location > 1337 > continent 1`] = `"Antarctica"`;
+
exports[`location > 1337 > country 1`] = `"Egypt"`;
exports[`location > 1337 > countryCode > noArgs 1`] = `"EH"`;
diff --git a/test/modules/location.spec.ts b/test/modules/location.spec.ts
index 1291efd3..2be7c489 100644
--- a/test/modules/location.spec.ts
+++ b/test/modules/location.spec.ts
@@ -77,6 +77,8 @@ describe('location', () => {
t.it('country');
+ t.it('continent');
+
t.describe('countryCode', (t) => {
t.it('noArgs')
.it('with string alpha-2', 'alpha-2')
@@ -145,6 +147,16 @@ describe('location', () => {
describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))(
'random seeded tests for seed %i',
() => {
+ describe('continent()', () => {
+ it('returns random continent', () => {
+ const actual = faker.location.continent();
+
+ expect(actual).toBeTruthy();
+ expect(actual).toBeTypeOf('string');
+ expect(faker.definitions.location.continent).toContain(actual);
+ });
+ });
+
describe('countryCode()', () => {
it('returns random alpha-2 countryCode', () => {
const countryCode = faker.location.countryCode('alpha-2');