Closed jacobbogers closed 9 months ago
If you know of a way that works without breaking all current environments (client, server, Node.js, Deno, etc.) feel free to open a PR
Thanks for your understanding, let me see if I can cook something up.
btw: I would prefer to not add additional complexity, since you can also pass your custom request function here: https://github.com/i18next/i18next-http-backend?tab=readme-ov-file#backend-options
To answer your question about request
Sure we can use request
, but our test regiment is to simulate at lowest level possible, (the actual network traffic and especially simulating errors, checking headers, or sending back incomplete data, delays, etc, etc) and see if our apps in an integration test setting can deal with this situation prorperly.
btw: I would prefer to not add additional complexity, since you can also pass your custom request function here: https://github.com/i18next/i18next-http-backend?tab=readme-ov-file#backend-options
Hi, Can you expose the "fetch" as pluggable, this would help greatly at testing especially as we dont use jest mocks (we use
it.concurrent
extensively will be an issue since jest mocks are global to test file)hence the need to make it pluggable per
it
testExample (just spitballing):
for mocking (integration tests)