Template Upload

This commit is contained in:
SOUTHERNCO\x2mjbyrn
2017-05-17 13:45:25 -04:00
parent 415b9c25f3
commit 7efe7605b8
11476 changed files with 2170865 additions and 34 deletions

26
node_modules/dev-ip/test/.jshintrc generated vendored Normal file
View File

@ -0,0 +1,26 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"sub": true,
"undef": false,
"unused": false,
"quotmark": "double",
"boss": true,
"eqnull": true,
"node": true,
"globals": {
"describe" : false,
"it" : false,
"expect" : false,
"runs" : false,
"waitsFor" : false,
"beforeEach" : false,
"afterEach" : false,
"before" : false,
"after" : false
}
}

77
node_modules/dev-ip/test/devip.js generated vendored Normal file
View File

@ -0,0 +1,77 @@
"use strict";
var devIp = require("../lib/dev-ip");
var respNone = require("./fixtures/resp-none");
var respSingle = require("./fixtures/resp-single");
var respMultiple = require("./fixtures/resp-multiple");
var sinon = require("sinon");
var assert = require("chai").assert;
var os = require("os");
// From the resp files
var match1 = "10.104.103.181";
var match2 = "10.104.100.12";
var regex = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
describe("Getting the IP with a single result", function () {
var osStub;
var result;
before(function () {
osStub = sinon.stub(os, "networkInterfaces").returns(respSingle);
});
beforeEach(function () {
result = devIp(null);
});
after(function () {
osStub.restore();
});
it("should return the IP when a single match found", function () {
var expected = match1;
assert.deepEqual(result, [expected]);
});
it("should return a string matching the regex", function () {
var actual = regex.exec(result);
assert.isNotNull(actual);
});
});
describe("Getting the IP with Multiple results", function () {
var osStub;
var result;
before(function () {
osStub = sinon.stub(os, "networkInterfaces").returns(respMultiple);
});
beforeEach(function () {
result = devIp(null);
});
after(function () {
osStub.restore();
});
it("should return an array of results", function () {
assert.equal(result[0], match1);
assert.equal(result[1], match2);
});
it("should return a string matching the regex", function () {
var actual = regex.exec(result[0]);
assert.isNotNull(actual);
actual = regex.exec(result[1]);
assert.isNotNull(actual);
});
});
describe("Getting the IP with no results", function () {
var osStub;
var result;
before(function () {
osStub = sinon.stub(os, "networkInterfaces").returns(respNone);
});
after(function () {
osStub.restore();
});
it("should return empty array", function () {
var actual = devIp();
assert.isArray(actual);
assert.equal(actual.length, 0);
});
});

35
node_modules/dev-ip/test/fixtures/resp-multiple.js generated vendored Normal file
View File

@ -0,0 +1,35 @@
module.exports = {
lo0: [
{
address: 'fe80::1',
family: 'IPv6',
internal: true
},
{
address: '127.0.0.1',
family: 'IPv4',
internal: true
},
{
address: '::1',
family: 'IPv6',
internal: true
}
],
en0: [
{
address: 'fe80::22c9:d0ff:fe44:6415',
family: 'IPv6',
internal: false },
{
address: '10.104.103.181',
family: 'IPv4',
internal: false
},
{
address: '10.104.100.12',
family: 'IPv4',
internal: false
}
]
}

19
node_modules/dev-ip/test/fixtures/resp-none.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
module.exports = {
lo0: [
{
address: 'fe80::1',
family: 'IPv6',
internal: true
},
{
address: '127.0.0.1',
family: 'IPv4',
internal: true
},
{
address: '::1',
family: 'IPv6',
internal: true
}
]
}

30
node_modules/dev-ip/test/fixtures/resp-single.js generated vendored Normal file
View File

@ -0,0 +1,30 @@
module.exports = {
lo0: [
{
address: 'fe80::1',
family: 'IPv6',
internal: true
},
{
address: '127.0.0.1',
family: 'IPv4',
internal: true
},
{
address: '::1',
family: 'IPv6',
internal: true
}
],
en0: [
{
address: 'fe80::22c9:d0ff:fe44:6415',
family: 'IPv6',
internal: false },
{
address: '10.104.103.181',
family: 'IPv4',
internal: false
}
]
}