Skip to content

Commit

Permalink
Merge 805b069 into a9ec1c4
Browse files Browse the repository at this point in the history
  • Loading branch information
turnerniles committed Feb 1, 2017
2 parents a9ec1c4 + 805b069 commit ada5af9
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 46 deletions.
120 changes: 74 additions & 46 deletions lib/quick-pivot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions test/logic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,26 @@ describe('accumulator', function() {
it('count', function() {
var accumulatedResults = accumulator(data, 'age', 'count');

expect(accumulatedResults).to.equal(8);
});
it('average', function() {
var accumulatedResults = accumulator(data, 'age', 'average');

expect(accumulatedResults).to.equal(28.75);
});
it('min', function() {
var accumulatedResults = accumulator(data, 'age', 'min');

expect(accumulatedResults).to.equal(28);
});
it('max', function() {
var accumulatedResults = accumulator(data, 'age', 'max');

expect(accumulatedResults).to.equal(30);
});
it('default', function() {
var accumulatedResults = accumulator(data, 'age', 'default');

expect(accumulatedResults).to.equal(8);
});
});
Expand Down

0 comments on commit ada5af9

Please sign in to comment.