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

Add nock to node test helper.

This commit is contained in:
Mark Hindess 2014-10-01 14:35:51 +01:00
parent 322a6ebed3
commit 8df9eee6d2

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,
};