Skip to content

Commit

Permalink
Merge pull request #181 from guidokessels/find-items-without-source
Browse files Browse the repository at this point in the history
Fix: Black Sun Assassin is missing from GfH
  • Loading branch information
guidokessels authored Jan 22, 2018
2 parents baea503 + 3962407 commit e03ff81
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,7 @@
},
"pilots": {
"253": 1,
"261": 2,
"262": 1,
"263": 1,
"264": 1
Expand Down
27 changes: 27 additions & 0 deletions tests/integrity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,31 @@ describe("All data", function() {
utils.outputAllErrors(errors);
});
});

describe('in sources.js', function () {
['upgrades', 'pilots', 'conditions', 'ships'].forEach(function (type) {
test("all " + type + " belong to at least 1 expansion pack", function () {
var idsInPack = [];
var errors = [];
var ids;
var i;

for (i = 0; i < Data.sources.length; i++) {
if (Data.sources[i].contents[type]) {
ids = Object.keys(Data.sources[i].contents[type]).map(d => parseInt(d, 10));
idsInPack = idsInPack.concat(ids);
}
}

for (i = 0; i < Data[type].length; i++) {
if (idsInPack.indexOf(Data[type][i].id) === -1) {
errors.push(utils.buildDataHeader(Data, type, i) +
": does not belong to any expansion pack");
}
}

utils.outputAllErrors(errors);
});
});
});
});

0 comments on commit e03ff81

Please sign in to comment.