diff options
Diffstat (limited to 'test/modules')
| -rw-r--r-- | test/modules/location.spec.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/modules/location.spec.ts b/test/modules/location.spec.ts index d9ce9c7f..bd50c8ef 100644 --- a/test/modules/location.spec.ts +++ b/test/modules/location.spec.ts @@ -192,6 +192,11 @@ describe('location', () => { expect(zipCode1).toBeLessThanOrEqual(upper); }); + it('should return a zip code with length 5 for ZIP codes that start with 0', () => { + const zipCode = fakerEN_US.location.zipCode({ state: 'NH' }); + expect(zipCode.length).toBe(5); + }); + it('should throw when definitions.location.postcode_by_state not set', () => { expect(() => faker.location.zipCode({ state: 'XX' })).toThrow( new FakerError( |
