I'm writing unit tests for a Node.js Express server. The server does some stuff that depends on the remote client's IP address, retrieved using req.ip
on the server.
How can I write unit tests that will spoof their own IP addresses to test the server's responses, or is there a better way to achieve the same end? (I'm writing the unit tests in jasmine-node, if it matters.)