aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSuyash Gulati <[email protected]>2024-10-29 21:18:32 +0530
committerGitHub <[email protected]>2024-10-29 16:48:32 +0100
commitc02beeadd49e48656a0307451517e9751e3118c3 (patch)
tree96ec1e3294b510acea9e733807ce1b9959b38034 /test
parent081a795411887a8b67bc0718eb5149e1bb5e5dfb (diff)
downloadfaker-c02beeadd49e48656a0307451517e9751e3118c3.tar.xz
faker-c02beeadd49e48656a0307451517e9751e3118c3.zip
feat(animal): add petName method (#3196)
Diffstat (limited to 'test')
-rw-r--r--test/modules/__snapshots__/animal.spec.ts.snap6
-rw-r--r--test/modules/animal.spec.ts10
2 files changed, 15 insertions, 1 deletions
diff --git a/test/modules/__snapshots__/animal.spec.ts.snap b/test/modules/__snapshots__/animal.spec.ts.snap
index f6ddbc3a..ae25d4f2 100644
--- a/test/modules/__snapshots__/animal.spec.ts.snap
+++ b/test/modules/__snapshots__/animal.spec.ts.snap
@@ -22,6 +22,8 @@ exports[`animal > 42 > insect 1`] = `"Gouty oak gall"`;
exports[`animal > 42 > lion 1`] = `"Cape lion"`;
+exports[`animal > 42 > petName 1`] = `"Ginger"`;
+
exports[`animal > 42 > rabbit 1`] = `"English Spot"`;
exports[`animal > 42 > rodent 1`] = `"Famatina chinchilla rat"`;
@@ -52,6 +54,8 @@ exports[`animal > 1211 > insect 1`] = `"Western paper wasp"`;
exports[`animal > 1211 > lion 1`] = `"West African Lion"`;
+exports[`animal > 1211 > petName 1`] = `"Scout"`;
+
exports[`animal > 1211 > rabbit 1`] = `"Silver Marten"`;
exports[`animal > 1211 > rodent 1`] = `"Strong tuco-tuco"`;
@@ -82,6 +86,8 @@ exports[`animal > 1337 > insect 1`] = `"Erythrina gall wasp"`;
exports[`animal > 1337 > lion 1`] = `"Barbary Lion"`;
+exports[`animal > 1337 > petName 1`] = `"Cooper"`;
+
exports[`animal > 1337 > rabbit 1`] = `"Cinnamon"`;
exports[`animal > 1337 > rodent 1`] = `"Crested porcupine"`;
diff --git a/test/modules/animal.spec.ts b/test/modules/animal.spec.ts
index 7ac332cb..ff5767e2 100644
--- a/test/modules/animal.spec.ts
+++ b/test/modules/animal.spec.ts
@@ -22,7 +22,8 @@ describe('animal', () => {
'rabbit',
'rodent',
'snake',
- 'type'
+ 'type',
+ 'petName'
);
});
@@ -133,6 +134,13 @@ describe('animal', () => {
expect(faker.definitions.animal.type).toContain(actual);
});
});
+
+ describe('petName()', () => {
+ it('should return random value from pet name array', () => {
+ const actual = faker.animal.petName();
+ expect(faker.definitions.animal.pet_name).toContain(actual);
+ });
+ });
}
);
});