Created
June 22, 2011 00:25
-
-
Save indexzero/1039272 to your computer and use it in GitHub Desktop.
A quick and dirty example of some APIs that could go into a "mock-request" library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mockRequest = require('mock-request'); | |
console.dir(mockRequest | |
.get('/auth').responds(200) | |
.get('/apps/mickey').responds(200, { /* some JSON */ })); | |
// [ | |
// { | |
// request: { | |
// // | |
// // Include more defaults here | |
// // | |
// path: '/auth' | |
// }, | |
// response: { | |
// // | |
// // Include more defaults here | |
// // | |
// statusCode: 200 | |
// } | |
// } | |
// ... | |
// ...plus data for `.get('/apps/mickey').responds(200, { /* some JSON */ }) | |
// ... | |
// ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment