Skip to content

Commit

Permalink
test: fix all functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Mar 21, 2022
1 parent 5642470 commit ac8904d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/all_functional.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ac8904d

Please sign in to comment.