knex/test/lib/aggregate.js

21 lines
409 B
JavaScript
Raw Normal View History

2013-05-08 20:16:39 -04:00
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);
});
};