You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'})constutil=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.
The text was updated successfully, but these errors were encountered:
This should be do-able using the module mocking from jest, for the mocking of Meilisearch and the setup file in jest (example: jest setup and setup script).
Currently, in
__tests__/utils.test.ts
, here the way to mock the config data and test the functionsgetSearchableFields
in every tests:It would be better to be able to mock the config just once and not in every test.
The text was updated successfully, but these errors were encountered: