diff options
| author | Shinigami <[email protected]> | 2022-05-01 15:28:11 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-01 13:28:11 +0000 |
| commit | e9c2b9de8dfa041401d16cddf976d235cf2dd495 (patch) | |
| tree | 98fd503dbe9965d9da914d463f1bbbd3d54b5a9f /test | |
| parent | c093e4c300a5566faafc85289d2588742db25c5d (diff) | |
| download | faker-e9c2b9de8dfa041401d16cddf976d235cf2dd495.tar.xz faker-e9c2b9de8dfa041401d16cddf976d235cf2dd495.zip | |
test: add tests (#894)
Diffstat (limited to 'test')
| -rw-r--r-- | test/helpers.spec.ts | 10 |
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', () => { |
