aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-05-01 15:28:11 +0200
committerGitHub <[email protected]>2022-05-01 13:28:11 +0000
commite9c2b9de8dfa041401d16cddf976d235cf2dd495 (patch)
tree98fd503dbe9965d9da914d463f1bbbd3d54b5a9f /test
parentc093e4c300a5566faafc85289d2588742db25c5d (diff)
downloadfaker-e9c2b9de8dfa041401d16cddf976d235cf2dd495.tar.xz
faker-e9c2b9de8dfa041401d16cddf976d235cf2dd495.zip
test: add tests (#894)
Diffstat (limited to 'test')
-rw-r--r--test/helpers.spec.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/helpers.spec.ts b/test/helpers.spec.ts
index a34886dd..e436e6dc 100644
--- a/test/helpers.spec.ts
+++ b/test/helpers.spec.ts
@@ -888,6 +888,11 @@ describe('helpers', () => {
expect(Object.keys(testObject)).toContain(actual);
});
+
+ it('should return undefined if given object is empty', () => {
+ const actual = faker.helpers.objectKey({});
+ expect(actual).toBeUndefined();
+ });
});
describe('objectValue', () => {
@@ -901,6 +906,11 @@ describe('helpers', () => {
expect(Object.values(testObject)).toContain(actual);
});
+
+ it('should return undefined if given object is empty', () => {
+ const actual = faker.helpers.objectValue({});
+ expect(actual).toBeUndefined();
+ });
});
describe('deprecation warnings', () => {