From 8df9eee6d25b02a9899701524a086f7b6db0d0da Mon Sep 17 00:00:00 2001 From: Mark Hindess Date: Wed, 1 Oct 2014 14:35:51 +0100 Subject: [PATCH] Add nock to node test helper. --- test/nodes/helper.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/nodes/helper.js b/test/nodes/helper.js index 94f0ca2f8..480f4ca1f 100644 --- a/test/nodes/helper.js +++ b/test/nodes/helper.js @@ -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, + };