From ac8904d398e1148d034616af243e615183e97c67 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Thu, 10 Mar 2022 22:26:31 +0100 Subject: [PATCH] test: fix all functional tests --- test/all_functional.spec.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/all_functional.spec.ts b/test/all_functional.spec.ts index a61661611ee..cb85074660a 100644 --- a/test/all_functional.spec.ts +++ b/test/all_functional.spec.ts @@ -55,7 +55,12 @@ const modules = modulesList(); describe('functional tests', () => { for (const locale in faker.locales) { describe(locale, () => { - faker.locale = locale; + // TODO: Enable after https://github.com/faker-js/faker/pull/269 + //it('title', () => { + // faker.locale = locale; + // expect(faker.definitions.title).toBe(faker.locales[locale].title); + //}); + Object.keys(modules).forEach((module) => { describe(module, () => { // if there is nothing to test, create a dummy test so the test runner doesn't complain @@ -65,6 +70,7 @@ describe('functional tests', () => { modules[module].forEach((meth) => { it(meth + '()', () => { + faker.locale = locale; const result = faker[module][meth](); if (meth === 'boolean') { expect(result).toBeTypeOf('boolean'); @@ -96,7 +102,7 @@ describe('faker.fake functional tests', () => { const result = faker.fake('{{' + module + '.' + meth + '}}'); // just make sure any result is returned // an undefined result usually means an error - expect(result).toBeDefined(); + expect(result).toBeTypeOf('string'); // if (meth === 'boolean') { // expect(result).toBeTypeOf('boolean'); // } else {