M
M
Mikhailo Poberezhny2016-06-24 15:01:44
Node.js
Mikhailo Poberezhny, 2016-06-24 15:01:44

How to run jasmine test with requests?

var request = require("request");

var base_url = "http://localhost:3000/"

describe("Hello World Server", function() {
  describe("GET /", function() {
    it("returns status code 200", function(done) {
      request.get(base_url, function(error, response, body) {
        expect(response.statusCode).toBe(200);
        done();
      });
    });
  });
});

How can I run this test on a GET request and is it even possible?
app.get('/test1', function (req, res) {
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question