Commit 121f6a7e authored by Vsevolod Strukchinsky's avatar Vsevolod Strukchinsky
Browse files

Added simple tests

parent eafdad01
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
  "description": "Promise-based Wrapper for XHR using Request and Bluebird",
  "main": "./lib/rp.js",
  "scripts": {
    "test": "To Do"
    "test": "istanbul test _mocha --report html -- test/*-test*.js -R spec"
  },
  "repository": {
    "type": "git",
@@ -21,5 +21,9 @@
  "dependencies": {
    "bluebird": "~1.0.1",
    "request": "~2.33.0"
  },
  "devDependencies": {
    "mocha": "~1.17.1",
    "istanbul": "~0.2.4"
  }
}

test/request-test.js

0 → 100644
+17 −0
Original line number Diff line number Diff line
var rp = require('../lib/rp.js');

describe('request tests', function () {

    it('should request google.com', function (done) {
        rp('http://www.google.com')
		    .then(done.bind(null, null))
		    .catch(done);
    });

    it('should catch errors', function (done) {
        rp('http://googl')
		    .then(done.bind(null, 'then callback was called'))
		    .catch(done.bind(null, null));
    });

});
 No newline at end of file