Make nock an optional dependency.

This commit is contained in:
Mark Hindess 2014-10-01 17:46:00 +01:00
parent c631b393e9
commit ea6313c9a1
1 changed files with 6 additions and 1 deletions

View File

@ -20,7 +20,12 @@ var request = require('supertest');
var nock;
if (!process.version.match(/^v0\.[0-9]\./)) {
// only set nock for node >= 0.10
nock = require('nock');
try {
nock = require('nock');
} catch (err) {
// nevermind, will skip nock tests
nock = null;
}
}
var RED = require("../../red/red.js");
var redNodes = require("../../red/nodes");