sequelizer.count.test.js 497 B

1234567891011121314151617
  1. var Sequelizer = require('../../../index')({ dialect: 'postgres' }).sequelizer;
  2. var analyze = require('../../support/analyze');
  3. var assert = require('assert');
  4. describe('Sequelizer ::', function() {
  5. describe('COUNT statements', function() {
  6. it('should generate a count query', function() {
  7. var tree = analyze({
  8. count: true,
  9. from: 'users'
  10. });
  11. var result = Sequelizer(tree);
  12. assert.equal(result.sql, 'select count(*) from "users"');
  13. });
  14. });
  15. });