sequelizer.where.null.test.js 662 B

123456789101112131415161718192021222324
  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('WHERE NULL statements', function() {
  6. it('should generate a query with a simple WHERE statement', function() {
  7. var tree = analyze({
  8. select: ['*'],
  9. from: 'users',
  10. where: {
  11. and: [
  12. {
  13. updatedAt: null
  14. }
  15. ]
  16. }
  17. });
  18. var result = Sequelizer(tree);
  19. assert.equal(result.sql, 'select * from "users" where "updatedAt" is null');
  20. });
  21. });
  22. });