Coder Social home page Coder Social logo

Mocking on proxying about nock HOT 7 CLOSED

nock avatar nock commented on May 9, 2024
Mocking on proxying

from nock.

Comments (7)

pgte avatar pgte commented on May 9, 2024

I think there is a misunderstanding here.

Nock doesn't make HTTP requests, it mocks servers, so your request never reaches the proxy.

And it looks here like you were trying to test node-http-proxy??

from nock.

andreareginato avatar andreareginato commented on May 9, 2024

Yes, I'm trying to test the proxy. I call it (running on :8000) and I want to intercept the underlying service which is called (running on :3000). I mocked :3000 but it isn't catch.

from nock.

pgte avatar pgte commented on May 9, 2024

Is the proxy being run on the same process as the test?

from nock.

andreareginato avatar andreareginato commented on May 9, 2024

No, the proxy is independent and let it running as another process. Then I
run the test suite.
If I try to catch the :8000 request it works fine, but not with the :3000.

Thanks for your time.

On Sat, Aug 18, 2012 at 1:11 AM, Pedro Teixeira [email protected]:

Is the proxy being run on the same process as the test?

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/73#issuecomment-7837867.

Andrea Reginato
Lelylan | reThink your house
http://lelylan.com

from nock.

pgte avatar pgte commented on May 9, 2024

OK, so that's why it doesn't work.
Nock mocks http requests, but you have to be on the same process to expect that to be mocked.

http://en.wikipedia.org/wiki/Mock_object

from nock.

andreareginato avatar andreareginato commented on May 9, 2024

Thanks a lot for your explanation.

On Sat, Aug 18, 2012 at 10:34 AM, Pedro Teixeira
[email protected]:

OK, so that's why it doesn't work.
Nock mocks http requests, but you have to be on the same process to expect
that to be mocked.

http://en.wikipedia.org/wiki/Mock_object

β€”
Reply to this email directly or view it on GitHubhttps://github.com//issues/73#issuecomment-7842885.

Andrea Reginato
Lelylan | reThink your house
http://lelylan.com

from nock.

lock avatar lock commented on May 9, 2024

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!

from nock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.