-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery.goto.test.js
41 lines (32 loc) · 1.02 KB
/
query.goto.test.js
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
41
const expect = require('chai').expect;
const my = require('../../src');
const config = require('../__config/default');
const tools = require('../__tools');
const {prepareForTesting, _________________} = tools;
describe('MySQL - query/goto', () => {
const table = 'users';
my.init(config);
prepareForTesting();
it(`.previous(table, idValue)`, async () => {
const idValue = 3;
const result = await my.previous(table, idValue);
expect(result.id === 2).to.be.true;
});
it(`.previous(table, idName, idValue)`, async () => {
const idName = 'id';
const idValue = 3;
const result = await my.previous(table, idName, idValue);
expect(result.id === 2).to.be.true;
});
it(`.next(table, idValue)`, async () => {
const idValue = 3;
const result = await my.next(table, idValue);
expect(result.id === 4).to.be.true;
});
it(`.next(table, idName, idValue)`, async () => {
const idName = 'id';
const idValue = 3;
const result = await my.next(table, idName, idValue);
expect(result.id === 4).to.be.true;
});
});