Skip to content

Commit a7f1f85

Browse files
author
Vincent Molinié
committed
test: add tests on operators
1 parent 4527138 commit a7f1f85

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/utils/operators.test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const sequelize = require('sequelize');
2+
const Operators = require('../../src/utils/operators');
3+
4+
describe('utils > operators', () => {
5+
describe('with an old sequelize', () => {
6+
it('should return a valid operator', () => {
7+
expect.assertions(2);
8+
9+
const Op = new Operators();
10+
expect(Op.AND).toStrictEqual('$and');
11+
expect(Op.CONTAINS).toStrictEqual('$contains');
12+
});
13+
});
14+
15+
describe('with an up to date sequelize', () => {
16+
it('should return a valid operator', () => {
17+
expect.assertions(2);
18+
19+
const Op = new Operators({ sequelize });
20+
expect(Op.AND).toStrictEqual(sequelize.Op.AND);
21+
expect(Op.CONTAINS).toStrictEqual(sequelize.Op.CONTAINS);
22+
});
23+
});
24+
});

0 commit comments

Comments
 (0)