Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests are hard to debug #126

Open
Fishbowler opened this issue Jul 14, 2018 · 5 comments
Open

Tests are hard to debug #126

Fishbowler opened this issue Jul 14, 2018 · 5 comments

Comments

@Fishbowler
Copy link
Collaborator

There are a variety of nock'd domains.
When HTTP_PROXY is set to debug the real httpbin tests, it takes all nock traffic too, and requires a lot of configuration of NO_PROXY (or just some faith in the tests that don't complete) that things are working.

Move all nock'd domains to a single host for easier configuration in a development environment.

@paulmelnikow
Copy link
Collaborator

Sounds good to me!

It seems like we should also remove mock_request which is deprecated, and replace everything with nock. Does that make sense?

@paulmelnikow
Copy link
Collaborator

Also! If we switch over to using promises and promise-based tests, we should be able to make our test setup should easier to reason about. Instead of .toss()-ing the tests we can make a .run() method that returns a promise and in most of our tests, invoke that.

@Fishbowler
Copy link
Collaborator Author

Started work on this.

@paulmelnikow
Copy link
Collaborator

I'm convinced adding this run() method is really important. It'll make our tests much better and it'll make it way nicer to use the library downstream. Let's tackle that after we clear the PR backlog.

@paulmelnikow
Copy link
Collaborator

run() added in #183 and most of the tests rewritten in #186 in a way that's way friendlier. mock-request is no longer being used.

Probably what's left is to rewrite the httpbin tests using local endpoints. I've been working on
nock and that's the strategy we're using there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants