diff --git a/src/faker.ts b/src/faker.ts index f8011b112c7..f99a1ff4d4d 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -83,12 +83,14 @@ export class Faker { constructor(opts: FakerOptions) { if (!opts) { - throw new Error('Options with at least one locale must be provided'); + throw new Error( + 'Options with at least one entry in locales must be provided' + ); } if (Object.keys(opts.locales ?? {}).length === 0) { throw new Error( - 'At least one locale must be provided in the locales parameter' + 'At least one entry in locales must be provided in the locales parameter' ); } diff --git a/test/faker.spec.ts b/test/faker.spec.ts index 0efc16e007b..32b2b94ff71 100644 --- a/test/faker.spec.ts +++ b/test/faker.spec.ts @@ -11,7 +11,9 @@ describe('faker', () => { () => // @ts-expect-error: mission options new Faker() - ).toThrow(Error('Options with at least one locale must be provided')); + ).toThrow( + Error('Options with at least one entry in locales must be provided') + ); }); it('should throw error if no locales passed', () => { @@ -20,7 +22,9 @@ describe('faker', () => { // @ts-expect-error: missing locales new Faker({}) ).toThrow( - Error('At least one locale must be provided in the locales parameter') + Error( + 'At least one entry in locales must be provided in the locales parameter' + ) ); });