/
query-interface.test.ts
40 lines (35 loc) · 1.42 KB
/
query-interface.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { expect } from 'chai';
import Support from '../../support';
const { sequelize } = Support as any;
describe('QueryInterface', () => {
describe('quoteIdentifier', () => {
// regression test which covers https://github.com/sequelize/sequelize/issues/12627
it('should quote the identifier', () => {
const identifier = 'identifier';
const quotedIdentifier = sequelize
.getQueryInterface()
.quoteIdentifier(identifier);
const expectedQuotedIdentifier = sequelize
.getQueryInterface()
.queryGenerator.quoteIdentifier(identifier);
expect(quotedIdentifier).not.to.be.undefined;
expect(expectedQuotedIdentifier).not.to.be.undefined;
expect(quotedIdentifier).to.equal(expectedQuotedIdentifier);
});
});
describe('quoteIdentifiers', () => {
// regression test which covers https://github.com/sequelize/sequelize/issues/12627
it('should quote the identifiers', () => {
const identifier = 'table.identifier';
const quotedIdentifiers = sequelize
.getQueryInterface()
.quoteIdentifiers(identifier);
const expectedQuotedIdentifiers = sequelize
.getQueryInterface()
.queryGenerator.quoteIdentifiers(identifier);
expect(quotedIdentifiers).not.to.be.undefined;
expect(expectedQuotedIdentifiers).not.to.be.undefined;
expect(quotedIdentifiers).to.equal(expectedQuotedIdentifiers);
});
});
});