1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #427 from hindessm/add-nock-to-node-test-helper

Add nock to node test helper.
This commit is contained in:
Nick O'Leary 2014-10-01 14:59:23 +01:00
commit c631b393e9

View File

@ -17,6 +17,11 @@
var should = require("should");
var when = require("when");
var request = require('supertest');
var nock;
if (!process.version.match(/^v0\.[0-9]\./)) {
// only set nock for node >= 0.10
nock = require('nock');
}
var RED = require("../../red/red.js");
var redNodes = require("../../red/nodes");
var flows = require("../../red/nodes/flows");
@ -62,8 +67,8 @@ module.exports = {
};
var settings = {
available: function() { return false; }
}
};
redNodes.init(settings, storage);
credentials.init(storage);
RED.nodes.registerType("helper", helperNode);
@ -113,4 +118,6 @@ module.exports = {
url: function() { return url; },
nock: nock,
};