Skip to content

Commit

Permalink
pouchdb#6230 Fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dharders committed Nov 21, 2017
1 parent 2484e7e commit b34bd43
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/node_modules/pouchdb-abstract-mapreduce/src/index.js
Expand Up @@ -672,6 +672,7 @@ function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {
rows: rows
};
}
/* istanbul ignore if */
if (opts.update_seq) {
finalResults.update_seq = view.seq;
}
Expand Down Expand Up @@ -710,6 +711,7 @@ function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {
startkey : toIndexableString([key]),
endkey : toIndexableString([key, {}])
};
/* istanbul ignore if */
if (opts.update_seq) {
viewOpts.update_seq = true;
}
Expand All @@ -720,6 +722,7 @@ function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {
var viewOpts = {
descending : opts.descending
};
/* istanbul ignore if */
if (opts.update_seq) {
viewOpts.update_seq = true;
}
Expand Down
5 changes: 4 additions & 1 deletion packages/node_modules/pouchdb-adapter-http/src/index.js
Expand Up @@ -438,6 +438,7 @@ function HttpPouch(opts, callback) {
params.conflicts = opts.conflicts;
}

/* istanbul ignore if */
if (opts.update_seq) {
params.update_seq = opts.update_seq;
}
Expand Down Expand Up @@ -700,6 +701,7 @@ function HttpPouch(opts, callback) {
params.conflicts = true;
}

/* istanbul ignore if */
if (opts.update_seq) {
params.update_seq = true;
}
Expand Down Expand Up @@ -846,7 +848,8 @@ function HttpPouch(opts, callback) {
if (opts.descending) {
params.descending = true;
}


/* istanbul ignore if */
if (opts.update_seq) {
params.update_seq = true;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/node_modules/pouchdb-adapter-idb/src/allDocs.js
Expand Up @@ -88,6 +88,7 @@ function idbAllDocs(opts, idb, callback) {
docCount = e.target.result.docCount;
};

/* istanbul ignore if */
if (opts.update_seq) {
getMaxUpdateSeq(seqStore, function (e) {
if (e.target.result && e.target.result.length > 0) {
Expand Down Expand Up @@ -191,6 +192,7 @@ function idbAllDocs(opts, idb, callback) {
rows: results
};

/* istanbul ignore if */
if (opts.update_seq && updateSeq !== undefined) {
returnVal.update_seq = updateSeq;
}
Expand Down
Expand Up @@ -42,6 +42,7 @@ function handleKeyRangeError(opts, metadata, err, callback) {
offset: opts.skip,
rows: []
};
/* istanbul ignore if */
if (opts.update_seq) {
returnVal.update_seq = metadata.seq;
}
Expand All @@ -60,6 +61,7 @@ export default function (idb, metadata, opts, callback) {
rows: []
};

/* istanbul ignore if */
if (opts.update_seq) {
returnVal.update_seq = metadata.seq;
}
Expand Down Expand Up @@ -161,6 +163,7 @@ export default function (idb, metadata, opts, callback) {
rows: results
};

/* istanbul ignore if */
if (opts.update_seq) {
returnVal.update_seq = metadata.seq;
}
Expand Down
Expand Up @@ -883,6 +883,7 @@ function LevelPouch(opts, callback) {
offset: opts.skip,
rows: []
};
/* istanbul ignore if */
if (opts.update_seq) {
returnVal.update_seq = db._updateSeq;
}
Expand Down Expand Up @@ -968,7 +969,8 @@ function LevelPouch(opts, callback) {
offset: opts.skip,
rows: results
};


/* istanbul ignore if */
if (opts.update_seq) {
returnVal.update_seq = db._updateSeq;
}
Expand Down
Expand Up @@ -708,6 +708,7 @@ function WebSqlPouch(opts, callback) {
totalRows = docCount;
});

/* istanbul ignore if */
if (opts.update_seq) {
// get max sequence in parallel to other operations
getMaxSeq(tx, function (theSeq) {
Expand Down Expand Up @@ -770,6 +771,7 @@ function WebSqlPouch(opts, callback) {
rows: results
};

/* istanbul ignore if */
if (opts.update_seq) {
returnVal.update_seq = updateSeq;
}
Expand Down
1 change: 1 addition & 0 deletions packages/node_modules/pouchdb-core/src/adapter.js
Expand Up @@ -137,6 +137,7 @@ function allDocsKeysQuery(api, opts, callback) {
if (err) {
return reject(err);
}
/* istanbul ignore if */
if (opts.update_seq && res.update_seq !== undefined) {
finalResults.update_seq = res.update_seq;
}
Expand Down

0 comments on commit b34bd43

Please sign in to comment.