knex/test/lib/aggregate.js
2013-05-15 14:57:00 -07:00

21 lines
409 B
JavaScript

module.exports = function(Knex, dbName, resolver) {
it('has a sum', function(ok) {
Knex('accounts')
.sum('logins')
.then(resolver(ok), ok);
});
it('has a count', function(ok) {
Knex('accounts').count('id').then(resolver(ok), ok);
});
it("support the groupBy function", function(ok) {
Knex('accounts').count('id').groupBy('logins').then(resolver(ok), ok);
});
};