(node:78457) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
which I think is a warning they are dropping or have dropped in newer node versions. But based on that I added the server mock. After that, I got the very clear message:
Cannot log after tests are done. Did you forget to wait for something async in your test?
Attempted to log "{
name: 'Error',
message: '\n' +
'No request handler found for GET http://localhost/api/users/current/usage.\n' +
'\n' +
'Make sure you have added a request handler for this request in your tests.\n' +
'\n' +
'Example:\n' +
'\n' +
'const { server, http } = useServerMock();\n' +
'server.use(\n' +
" http.get('/api/users/current/usage', ({ response }) => {\n" +
' return response(200).json({});\n' +
' })\n' +
');\n' +
It would be great if I just got by default when running a jest test I think and then ideally failing the tests on any unmocked API calls.
Sometimes these blow up in really clear ways but sometimes they don't. Take for instance - https://github.com/galaxyproject/galaxy/pull/19186/commits/21b8b9e41adbe00d642f594eedbd8b82e171438f. I just noticed the output in the logs:
which I think is a warning they are dropping or have dropped in newer node versions. But based on that I added the server mock. After that, I got the very clear message:
It would be great if I just got by default when running a jest test I think and then ideally failing the tests on any unmocked API calls.