diff --git a/test/string.spec.ts b/test/string.spec.ts index 604ec4fef2c..17c5cf60709 100644 --- a/test/string.spec.ts +++ b/test/string.spec.ts @@ -369,7 +369,7 @@ describe('string', () => { describe(`binary`, () => { it('generates a single binary character when no additional argument was provided', () => { const binary = faker.string.binary(); - expect(binary).toMatch(/^0x[01]*$/i); + expect(binary).toMatch(/^0x[01]$/i); expect(binary).toHaveLength(3); }); @@ -408,7 +408,7 @@ describe('string', () => { describe(`octal`, () => { it('generates single octal character when no additional argument was provided', () => { const octal = faker.string.octal(); - expect(octal).toMatch(/^0x[0-7]*$/i); + expect(octal).toMatch(/^0x[0-7]$/i); expect(octal).toHaveLength(3); });