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
In the new thor package, for the unit tests we are currently using a hardcoded mockHttpClient method on every unit tests so to avoid all that copy/paste this ticket aims to have a MockHttpClient that is light-weight and modulable for all the unit tests current and future.
Basic Example
This is the current mockHttpClient (this one is only for POST requests: const mockHttpClient = <T>(response: T): FetchHttpClient => { return { post: jest.fn().mockImplementation(() => { return { json: jest.fn().mockImplementation(() => { return response; }) }; }) } as unknown as FetchHttpClient; };
The text was updated successfully, but these errors were encountered:
Summary
In the new
thor
package, for the unit tests we are currently using a hardcodedmockHttpClient
method on every unit tests so to avoid all that copy/paste this ticket aims to have a MockHttpClient that is light-weight and modulable for all the unit tests current and future.Basic Example
This is the current mockHttpClient (this one is only for POST requests:
const mockHttpClient = <T>(response: T): FetchHttpClient => { return { post: jest.fn().mockImplementation(() => { return { json: jest.fn().mockImplementation(() => { return response; }) }; }) } as unknown as FetchHttpClient; };
The text was updated successfully, but these errors were encountered: