Skip to content

DanskSupermarked/fakeweb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Fakeweb

A simple tool that will intercept requests made via http.request and mikeal's request module and respond with dummy data.

Heavily inspired by: https://github.com/chrisk/fakeweb

Installation

npm install node-fakeweb

Basic Examples

var request = require('request');
var fakeweb = require('node-fakeweb');
var output = function(err, resp, body) { console.log(body); }

fakeweb.allowNetConnect = false;
fakeweb.registerUri({uri: 'http://www.testing.com:80/', body: 'Hello!'});
request.get({uri: 'http://www.testing.com:80/'}, output);

This will output:

[ctide ~]:~$ node test/test.js
Hello!

About

Testing tool to create dummy responses to HTTP requests, modeled after: https://github.com/chrisk/fakeweb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%