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 should send mocked requests to fake hostname #1351

Closed
paulmelnikow opened this issue Jan 4, 2019 · 15 comments · Fixed by #1691
Closed

Tests should send mocked requests to fake hostname #1351

paulmelnikow opened this issue Jan 4, 2019 · 15 comments · Fixed by #1691

Comments

@paulmelnikow
Copy link
Member

Let's change them all from e.g. example.com and www.google.com to example.test.

See #1347 (comment)

@paulmelnikow paulmelnikow changed the title Send mocked requests to fake hostname Tests should send mocked requests to fake hostname Jan 4, 2019
@jlilja
Copy link
Member

jlilja commented Jan 6, 2019

Mind if I take this? Seeing as its marked as a first time issue, should I let someone else take it? :)

@paulmelnikow
Copy link
Member Author

Go for it!!

I try to be really generous with tagging good first issues. There's a ton of work that can be done on this project and I don't think we need to worry about not creating enough of it. 😁

@gr2m
Copy link
Member

gr2m commented Jan 6, 2019

Thanks @paulmelnikow, this great!

@jlilja
Copy link
Member

jlilja commented Jan 17, 2019

Alright. I think I got most of these done. Some of the tests make assertions based on actually getting through - like enable net connect and allowUnmocked options.

How about setting google.com for those requests that actually have to go through, and a.google.com for subdomain checks?

@paulmelnikow
Copy link
Member Author

Ah, I came across one like that before as well. If the tests are still based on getting through, they need to be rewritten. Basically, they should have used AIRPLANE but didn't. You could add TODOs, I think…

@jlilja
Copy link
Member

jlilja commented Jan 17, 2019

Oh right. Yeah I'll add TODOs and make an PR out of it.

@gr2m
Copy link
Member

gr2m commented Jan 18, 2019

Maybe instead of using google.com, we could spawn our own servers and mock localhost?

@paulmelnikow
Copy link
Member Author

@jlilja How are you coming with this? It'd be great to get these updated so new contributors add tests in the style we want. Even if it's only partly done we could merge it.

@jlilja
Copy link
Member

jlilja commented Jan 27, 2019

Hi, yes of course. I'm working on it right now.

I'll push the changing of names soon, then another PR for converting the other ones needing its own server.

@ehabdevel
Copy link

I may came late to this but,
wasn't it be more clear if using a domain like this:-> http://www.someSite.url
which also doesn’t send requests to a real domain.

@gr2m
Copy link
Member

gr2m commented Feb 14, 2019

I think .test is made for exactly this use case, see https://en.wikipedia.org/wiki/.test

The name test is a top-level domain (TLD) that is intended for use in the testing of software.

@stale
Copy link

stale bot commented May 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We try to do our best, but nock is maintained by volunteers and there is only so much we can do at a time. Thank you for your contributions.

@stale stale bot added the stale label May 15, 2019
@gr2m gr2m added the pinned label May 15, 2019
@stale stale bot removed the stale label May 15, 2019
paulmelnikow added a commit that referenced this issue Jul 8, 2019
paulmelnikow added a commit that referenced this issue Jul 8, 2019
paulmelnikow added a commit that referenced this issue Jul 16, 2019
mastermatt added a commit to mastermatt/nock that referenced this issue Jul 23, 2019
@mastermatt
Copy link
Member

I think this is done. @paulmelnikow do you want to give the tests one last check before closing this issue?

@paulmelnikow
Copy link
Member Author

paulmelnikow commented Jul 25, 2019

These are the ones I'm still seeing:

I'm not sure if any of these involve sending requests, though I think it's better we replace these with .test domains if possible.

@paulmelnikow
Copy link
Member Author

I've opened PRs for the rest of these.

gr2m pushed a commit that referenced this issue Sep 4, 2019
gr2m pushed a commit that referenced this issue Sep 4, 2019
gr2m pushed a commit that referenced this issue Sep 4, 2019
gr2m pushed a commit that referenced this issue Sep 4, 2019
gr2m pushed a commit that referenced this issue Sep 4, 2019
gr2m pushed a commit that referenced this issue Sep 4, 2019
gr2m pushed a commit that referenced this issue Sep 5, 2019
gr2m pushed a commit that referenced this issue Sep 5, 2019
gr2m pushed a commit that referenced this issue Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants