-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhealth.integ.test.ts
More file actions
60 lines (54 loc) · 1.71 KB
/
Copy pathhealth.integ.test.ts
File metadata and controls
60 lines (54 loc) · 1.71 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import 'should';
import * as http from 'http';
import { app as awmApp } from '../../advancedWalletManagerApp';
import { app as mbeApp } from '../../masterBitGoExpressApp';
import { AppMode, TlsMode, SigningMode } from '../../shared/types';
import { listen, close } from './helpers/servers';
describe('integration — health checks', () => {
let awmServer: http.Server;
let mbeServer: http.Server;
let awmPort: number;
let mbePort: number;
before(async () => {
awmServer = http.createServer(
awmApp({
appMode: AppMode.ADVANCED_WALLET_MANAGER,
tlsMode: TlsMode.DISABLED,
signingMode: SigningMode.LOCAL,
port: 0,
bind: '127.0.0.1',
timeout: 30000,
httpLoggerFile: '',
keyProviderUrl: 'http://127.0.0.1:3082',
}),
);
awmPort = await listen(awmServer);
mbeServer = http.createServer(
mbeApp({
appMode: AppMode.MASTER_EXPRESS,
tlsMode: TlsMode.DISABLED,
port: 0,
bind: '127.0.0.1',
timeout: 30000,
httpLoggerFile: '',
env: 'test',
disableEnvCheck: true,
advancedWalletManagerUrl: `http://127.0.0.1:${awmPort}`,
awmServerCertAllowSelfSigned: true,
}),
);
mbePort = await listen(mbeServer);
});
after(async () => {
await close(awmServer);
await close(mbeServer);
});
it('AWM /ping returns 200', async () => {
const res = await fetch(`http://127.0.0.1:${awmPort}/ping`, { method: 'POST' });
res.status.should.equal(200);
});
it('MBE /advancedwallet/ping returns 200', async () => {
const res = await fetch(`http://127.0.0.1:${mbePort}/advancedwallet/ping`, { method: 'POST' });
res.status.should.equal(200);
});
});