/
server.test.js
45 lines (36 loc) · 1.13 KB
/
server.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
42
43
44
45
const expect = require('chai').expect;
const my = require('../../src');
const config = require('../__config/default');
const tools = require('../__tools');
const {prepareForTesting, _________________} = tools;
describe('MySQL - server', () => {
const databaseName = config.testOptions.database;
const testDatabaseName = databaseName + '_xxx';
my.init(config);
prepareForTesting();
it(`.switchToServer(config)`, async () => {
const cfg = config;
const result = await my.switchToServer(cfg);
expect(result === true).to.be.true;
});
it(`.switchToServer(host)`, async () => {
const cfg = config;
const host = cfg.host;
const result = await my.switchToServer(host);
expect(result === true).to.be.true;
});
it(`.switchToServer()`, async () => {
const result = await my.switchToServer();
expect(result === true).to.be.true;
});
it(`.connectServer()`, async () => {
const cfg = config;
const result = await my.connectServer(cfg);
expect(result === true).to.be.true;
});
it(`.isServerOnline()`, async () => {
const cfg = config;
const result = await my.isServerOnline(cfg);
expect(result === true).to.be.true;
});
});