mirror of
https://github.com/knex/knex.git
synced 2025-09-17 12:13:53 +00:00
32 lines
542 B
JavaScript
32 lines
542 B
JavaScript
var when = require("when");
|
|
|
|
module.exports = function(knex) {
|
|
|
|
describe('Aggregate', function() {
|
|
|
|
it('has a sum', function() {
|
|
|
|
return knex('accounts').logMe().sum('logins');
|
|
|
|
});
|
|
|
|
it('has a count', function() {
|
|
|
|
return knex('accounts').logMe().count('id');
|
|
|
|
});
|
|
|
|
it("support the groupBy function", function() {
|
|
|
|
return knex('accounts').logMe().count('id').groupBy('logins').then(function() {
|
|
return knex('accounts').logMe().count('id').groupBy('first_name');
|
|
});
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|