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

Nock test suite breaking on Node 8.x #922

Closed
stevenvachon opened this issue May 30, 2017 · 9 comments
Closed

Nock test suite breaking on Node 8.x #922

stevenvachon opened this issue May 30, 2017 · 9 comments

Comments

@stevenvachon
Copy link

stevenvachon commented May 30, 2017

  • My project's test suite breaks
  • Nock's test suite breaks
@stevenvachon stevenvachon changed the title Tests breaking on Node 8.x Nock test suite breaking on Node 8.x May 31, 2017
@lukechilds
Copy link

My tests are breaking in Node.js 8.

Something simple like:

nock('http://example.com')
    .get('/')
    .reply(200, 'Hi!');

Doesn't get intercepted.

Using Node.js 7 it does.

@lukechilds
Copy link

@stevenvachon If you need to mock something in Node.js 8 now I just bashed create-test-server together.

No docs yet but you can see example usage here:
https://github.com/lukechilds/clone-response/blob/master/test/clone-response.js

@stevenvachon
Copy link
Author

@lukechilds thank you, but I transitioned from a real test server to nock a while ago and don't want to go back to it

@StarpTech
Copy link
Contributor

I also run into this issue I see there is already a PR to make nock node 8 ready. I hope it will reviewed fast.

@stevenvachon
Copy link
Author

@StarpTech that PR doesn't pass tests, so it's not yet of any use.

@StarpTech
Copy link
Contributor

@stevenvachon He said that there is only one browserify test failing. Thats a great base. BTW I think I will change to https://github.com/ctimmerm/axios-mock-adapter in combination with the excellent axios http request library. This not a solution for everybody but a much cleaner way to mock http calls in node.

@Rob--W
Copy link

Rob--W commented Jul 13, 2017

This PR seems to fix the issue: #929

For my own project, where I only use nock to mock responses, I've monkey-patched nock to get the tests to pass: Rob--W/cors-anywhere@70400ab (tested with nock 8.2.1).

@ianwsperber
Copy link
Contributor

Should be fixed in 9.0.14. Please reopen if issue persists.

kevinoid added a commit to kevinoid/appveyor-status that referenced this issue Jun 29, 2018
9.0.14 includes nock/nock#929 which fixes nock/nock#922 and
nock/nock#925 which prevented nock from working on Node 8 and later.
Now test everything on all supported Node versions.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
@lock
Copy link

lock bot commented Sep 13, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Sep 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants