Skip to content

Commit

Permalink
Unit test for duplicates in Qty.getKinds()
Browse files Browse the repository at this point in the history
  • Loading branch information
dubejf committed Jun 23, 2015
1 parent 3fc42fe commit b8afbeb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/quantitiesSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,15 @@ describe("js-quantities", function() {
it("should return an array of kind names", function() {
expect(Qty.getKinds()).toContain("resistance");
});

it("should not contain duplicate kind names", function() {
var kinds = Qty.getKinds();
var map = {};
kinds.forEach(function(kind) {
map[kind] = 1;
});
expect(kinds.length).toEqual(Object.keys(map).length);
});
});

describe("non regression tests", function() {
Expand Down

0 comments on commit b8afbeb

Please sign in to comment.