Skip to content

Commit

Permalink
Merge pull request #1102 from ParsePlatform/flovilmart.vendorCoverage
Browse files Browse the repository at this point in the history
Ignores uncovered mongodbURL
  • Loading branch information
flovilmart committed Mar 19, 2016
2 parents 8b7779a + 13a33a9 commit c39ba3b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"flow-bin": "^0.22.0",
"gaze": "^0.5.2",
"jasmine": "^2.3.2",
"mongodb-runner": "^3.1.15",
"mongodb-runner": "3.1.15",
"nodemon": "^1.8.1"
},
"scripts": {
Expand Down
13 changes: 13 additions & 0 deletions src/vendor/mongodbUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -429,6 +432,7 @@ function validateHostname(self, rest, hostname) {
}
}

/* istanbul ignore next: improve coverage */
function autoEscapeStr(rest) {
var newRest = '';
var lastPos = 0;
Expand Down Expand Up @@ -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.
Expand All @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand All @@ -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];
Expand All @@ -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 = '';
Expand Down

0 comments on commit c39ba3b

Please sign in to comment.