I'm trying a simple request, with nock catching, this seems to have broken recently am running Node v0.8.8.
Nock version: "0.13.3"
Request version: "2.11.0"
describe(".status", function() {
it("should fetch the device status", function(done) {
var scope = nock("http://example.com")
.get("/data_request?id=lu_sdata")
.replyWithFile(200, __dirname + "/fixtures/lu_sdata.json");
client.getStatus(function(error, response, result) {
expect(result.model).toBe("MiCasaVerde VeraLite");
done();
});
})
})
Client.prototype.getStatus = function(callback) {
var request_url = this.url + "/data_request?id=lu_sdata";
request({ url: request_url }, function (error, response, body) {
callback(error, response, JSON.parse(body));
});
};
/home/kevin/Source/javascript/vera/node_modules/request/main.js:517
if (response.connection.listeners('error').indexOf(self._parserErrorHandle
^
TypeError: Cannot call method 'listeners' of undefined
at OverridenClientRequest. (/home/kevin/Source/javascriptclient/node_modules/request/main.js:517:29)
at OverridenClientRequest.EventEmitter.emit (events.js:88:17)
at end (/home/kevin/Source/javascript/client/node_modules/nock/lib/request_overrider.js:206:11)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
I'm trying a simple request, with nock catching, this seems to have broken recently am running Node v0.8.8.
Nock version: "0.13.3"
Request version: "2.11.0"
describe(".status", function() {
it("should fetch the device status", function(done) {
var scope = nock("http://example.com")
.get("/data_request?id=lu_sdata")
.replyWithFile(200, __dirname + "/fixtures/lu_sdata.json");
})
Client.prototype.getStatus = function(callback) {
var request_url = this.url + "/data_request?id=lu_sdata";
request({ url: request_url }, function (error, response, body) {
callback(error, response, JSON.parse(body));
});
};
/home/kevin/Source/javascript/vera/node_modules/request/main.js:517
if (response.connection.listeners('error').indexOf(self._parserErrorHandle
^
TypeError: Cannot call method 'listeners' of undefined
at OverridenClientRequest. (/home/kevin/Source/javascriptclient/node_modules/request/main.js:517:29)
at OverridenClientRequest.EventEmitter.emit (events.js:88:17)
at end (/home/kevin/Source/javascript/client/node_modules/nock/lib/request_overrider.js:206:11)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)