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
There are several points about our test utilities (test/helpers.ts) that I find unpleasant:
Introduce too much logic and, respectively, boilerplate to be used.
The concept of pool and automatic lookup is terrible. Use jest.fn() instead!
All written in a single, large file, making them hard to read.
Expected behavior
Get rid of utilities that are written only for the sake of promisifying callback-based request modules (i.e. http/XMLHttpRequest). Embrace those modules directly, this will improve their reliability and increase their referencing factor.
Structure the remaining utilities under their respective surface: test/helpers/http.ts, test/helpers/XMLHttpRequest.ts, etc.).
Adjust the affected tests.
The text was updated successfully, but these errors were encountered:
There are several points about our test utilities (
test/helpers.ts
) that I find unpleasant:pool
and automatic lookup is terrible. Usejest.fn()
instead!Expected behavior
http
/XMLHttpRequest
). Embrace those modules directly, this will improve their reliability and increase their referencing factor.test/helpers/http.ts
,test/helpers/XMLHttpRequest.ts
, etc.).The text was updated successfully, but these errors were encountered: