0.4.3 • Published 9 years ago

hmock v0.4.3

Weekly downloads
2
License
-
Repository
github
Last release
9 years ago

node-hmock

Very simple http request/response mocking for Node.JS

Build Status

Installation

npm install hmock

Usage

describe('#getSomething', function() {
  it('should make a GET request and get a response', function(done) {
    var expectedResponse = { 
      ok: true 
    };

    hmock.expect()
      .get('http://somewhere:3000/out/there')
      .respond()
      .withBody(expectedResponse);

    new MyClass().getSomething(function(err, result) {
      assert.equal(null, err);
      assert.deepEqual(expectedResponse, result);

      hmock.verify();
      
      done();
    });
  });
});

See test/http.tests.js and/or test/https.tests.js for more detailed examples.

License

            DO WHATEVER THE FUCK YOU WANT, PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

            0. You just DO WHATEVER THE FUCK YOU WANT.
0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

10 years ago

0.3.0

11 years ago

0.2.3

11 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago