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
{{ message }}
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.
Now that we're using Jest, we can use Promise returns, async/await, and the .resolves and .rejects matchers instead of using the expectations coupled with supertest (which I have a feeling don't fully support Jest's logging the way that the built in matchers do).
Node HTTP clients using Promises
util.promisify(http.request) (Node 8 or the util.promisify shim package)
node-fetch (implementation of fetch for Node)
axios
r2
request-promise
The text was updated successfully, but these errors were encountered:
I tried to start this in #55, turns out it's a lot of work because we're coupled with how supertest can make requests against servers and callbacks. While Jest makes async expectations easy, we'd have to refactor all the tests to manually open and close servers or use a custom request utility that does this. The latter approach seems to be working so far but I'm going to take a break from this since it involves so much work migrating tests.
This may or may not be worth it. I don't like coupling the way we make requests to the way we make expectations about them because it makes it difficult to use Jest's awesome async matchers. But it may be more work than it's worth for now.
Thanks, I'm aware of that, I actually used it in some in progress code for migrating away from supertest. However, Jest has resolves and rejects matchers and async/await support (and Babel support if you're testing on a Node version that doesn't have it natively). I'd rather stick to Jest's built in matchers for their improved error messages and framework integrations. We could also just switch from supertest to superagent, though we unfortunately lose the ability to pass a server to the initial request function.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Now that we're using Jest, we can use Promise returns, async/await, and the
.resolves
and.rejects
matchers instead of using the expectations coupled with supertest (which I have a feeling don't fully support Jest's logging the way that the built in matchers do).Node HTTP clients using Promises
util.promisify(http.request)
(Node 8 or theutil.promisify
shim package)node-fetch
(implementation offetch
for Node)axios
r2
request-promise
The text was updated successfully, but these errors were encountered: