Skip to content

Commit

Permalink
1.0.0 Keeping the latest response in case of duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Vila committed Feb 12, 2019
1 parent b55859e commit bf006d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## 1.0.0 - 2019-02-12

### Changed
- Keeping the latest request response in the fixutres instead of the first
one in the case of duplicates

## 0.3.0 - 2019-02-12

### Added
Expand Down
3 changes: 2 additions & 1 deletion lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const compareByUrl = (scopeA, scopeB) => {
const removeDuplicates = (outputs) => {
const obj = {};
return Object.keys(outputs.reduce((prev, next) => {
if (!obj[next.path]) obj[next.path] = next;
// if (!obj[next.path]) obj[next.path] = next; // This would keep the oldest value
obj[next.path] = next; // This keeps the newest value
return obj;
}, obj)).map(i => obj[i]);
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nock-back-ci",
"version": "0.3.0",
"version": "1.0.0",
"description": "A simple acceptance testing helper optimised for complex CI problems",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit bf006d3

Please sign in to comment.