Skip to content

A better way to modify of config between test #23

@alallema

Description

@alallema

Currently, in __tests__/utils.test.ts, here the way to mock the config data and test the functions getSearchableFields in every tests:

  test('return list with one field', () => {
    restoreEnv = mockedEnv({ ...environment, SEARCHABLE_FIELDS: 'field' })
    const util = require('../src/util')
    mockGetSearchableFields = util.getSearchableFields()
    expect(mockGetSearchableFields).toMatchObject(['field'])
  })

It would be better to be able to mock the config just once and not in every test.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions