sequelizer.skip.test.js 591 B

12345678910111213141516171819
  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('SKIP statements', function() {
  6. it('should generate a simple query with a SKIP statement', function() {
  7. var tree = analyze({
  8. select: ['*'],
  9. from: 'users',
  10. skip: 10
  11. });
  12. var result = Sequelizer(tree);
  13. assert.equal(result.sql, 'select * from "users" offset $1');
  14. assert.deepEqual(result.bindings, ['10']);
  15. });
  16. });
  17. });