-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example.test.ts
36 lines (29 loc) · 943 Bytes
/
Example.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
import { Container } from 'dockerode';
import { connect } from './lib/Index';
import { runWorpdressTestContainer } from './test/Utils';
jasmine.DEFAULT_TIMEOUT_INTERVAL = 150000;
const wpPort = 9001;
const mysqlPort = 9002;
let wpContainer: Container;
let mysqlContainer: Container;
describe('Example test', () => {
beforeAll(async (done) => {
[wpContainer, mysqlContainer] = await runWorpdressTestContainer(9001, 9002);
done();
});
it('Connecting to Wordpress Rest API endpoint', async (done) => {
try {
const connection = await connect(`http://${wpContainer.modem.host}:${wpPort}`);
} catch (e) {
done();
}
done();
});
afterAll(async (done) => {
await wpContainer.stop();
await mysqlContainer.stop();
await wpContainer.remove({ v: true });
await mysqlContainer.remove({ v: true });
done();
});
});