query-interface.test.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. import { expect } from 'chai';
  2. import { sequelize } from '../../../support';
  3. describe('QueryInterface', () => {
  4. describe('quoteIdentifier', () => {
  5. // regression test which covers https://github.com/sequelize/sequelize/issues/12627
  6. it('should quote the identifier', () => {
  7. const identifier = 'identifier';
  8. const quotedIdentifier = sequelize.queryInterface.quoteIdentifier(identifier);
  9. const expectedQuotedIdentifier =
  10. sequelize.queryInterface.queryGenerator.quoteIdentifier(identifier);
  11. expect(quotedIdentifier).not.to.be.undefined;
  12. expect(expectedQuotedIdentifier).not.to.be.undefined;
  13. expect(quotedIdentifier).to.equal(expectedQuotedIdentifier);
  14. });
  15. });
  16. describe('quoteIdentifiers', () => {
  17. // regression test which covers https://github.com/sequelize/sequelize/issues/12627
  18. it('should quote the identifiers', () => {
  19. const identifier = 'table.identifier';
  20. const quotedIdentifiers = sequelize.queryInterface.quoteIdentifiers(identifier);
  21. const expectedQuotedIdentifiers =
  22. sequelize.queryInterface.queryGenerator.quoteIdentifiers(identifier);
  23. expect(quotedIdentifiers).not.to.be.undefined;
  24. expect(expectedQuotedIdentifiers).not.to.be.undefined;
  25. expect(quotedIdentifiers).to.equal(expectedQuotedIdentifiers);
  26. });
  27. });
  28. });