Ignores uncovered mongodbURL

This commit is contained in:
Florent Vilmart
2016-03-19 13:17:02 -04:00
parent 8b7779a0a9
commit 46c66667c1

View File

@@ -66,6 +66,7 @@ const slashedProtocol = {
};
const querystring = require('querystring');
/* istanbul ignore next: improve coverage */
function urlParse(url, parseQueryString, slashesDenoteHost) {
if (url instanceof Url) return url;
@@ -74,6 +75,7 @@ function urlParse(url, parseQueryString, slashesDenoteHost) {
return u;
}
/* istanbul ignore next: improve coverage */
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
if (typeof url !== 'string') {
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
@@ -394,6 +396,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
return this;
};
/* istanbul ignore next: improve coverage */
function validateHostname(self, rest, hostname) {
for (var i = 0, lastPos; i <= hostname.length; ++i) {
var code;
@@ -429,6 +432,7 @@ function validateHostname(self, rest, hostname) {
}
}
/* istanbul ignore next: improve coverage */
function autoEscapeStr(rest) {
var newRest = '';
var lastPos = 0;
@@ -531,6 +535,7 @@ function autoEscapeStr(rest) {
}
// format a parsed object into a url string
/* istanbul ignore next: improve coverage */
function urlFormat(obj) {
// ensure it's an object, and not a string url.
// If it's an obj, this is a no-op.
@@ -547,6 +552,7 @@ function urlFormat(obj) {
return obj.format();
}
/* istanbul ignore next: improve coverage */
Url.prototype.format = function() {
var auth = this.auth || '';
if (auth) {
@@ -623,19 +629,23 @@ Url.prototype.format = function() {
return protocol + host + pathname + search + hash;
};
/* istanbul ignore next: improve coverage */
function urlResolve(source, relative) {
return urlParse(source, false, true).resolve(relative);
}
/* istanbul ignore next: improve coverage */
Url.prototype.resolve = function(relative) {
return this.resolveObject(urlParse(relative, false, true)).format();
};
/* istanbul ignore next: improve coverage */
function urlResolveObject(source, relative) {
if (!source) return relative;
return urlParse(source, false, true).resolveObject(relative);
}
/* istanbul ignore next: improve coverage */
Url.prototype.resolveObject = function(relative) {
if (typeof relative === 'string') {
var rel = new Url();
@@ -908,6 +918,7 @@ Url.prototype.resolveObject = function(relative) {
return result;
};
/* istanbul ignore next: improve coverage */
Url.prototype.parseHost = function() {
var host = this.host;
var port = portPattern.exec(host);
@@ -922,6 +933,7 @@ Url.prototype.parseHost = function() {
};
// About 1.5x faster than the two-arg version of Array#splice().
/* istanbul ignore next: improve coverage */
function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
list[i] = list[k];
@@ -931,6 +943,7 @@ function spliceOne(list, index) {
var hexTable = new Array(256);
for (var i = 0; i < 256; ++i)
hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
/* istanbul ignore next: improve coverage */
function encodeAuth(str) {
// faster encodeURIComponent alternative for encoding auth uri components
var out = '';