Skip to content

Commit 788e3f8

Browse files
feat(mbe): fix rebase
1 parent 3fc3f3b commit 788e3f8

File tree

2 files changed

+13
-40
lines changed

2 files changed

+13
-40
lines changed

src/__tests__/api/master/nonRecovery.test.ts

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ describe('Non Recovery Tests', () => {
2020
port: 0,
2121
bind: 'localhost',
2222
timeout: 60000,
23-
logFile: '',
2423
env: 'test',
2524
disableEnvCheck: true,
2625
authVersion: 2,
2726
enclavedExpressUrl: enclavedExpressUrl,
2827
enclavedExpressCert: 'dummy-cert',
2928
tlsMode: TlsMode.DISABLED,
30-
mtlsRequestCert: false,
29+
httpLoggerFile: '',
3130
allowSelfSigned: true,
3231
recoveryMode: false,
3332
};
@@ -37,36 +36,7 @@ describe('Non Recovery Tests', () => {
3736
nock.enableNetConnect('127.0.0.1');
3837

3938
// Create mock BitGo instance with base functionality
40-
mockBitgo = {
41-
coin: sinon.stub(),
42-
_coinFactory: {},
43-
_useAms: false,
44-
initCoinFactory: sinon.stub(),
45-
registerToken: sinon.stub(),
46-
getValidate: sinon.stub(),
47-
validateAddress: sinon.stub(),
48-
verifyAddress: sinon.stub(),
49-
verifyPassword: sinon.stub(),
50-
encrypt: sinon.stub(),
51-
decrypt: sinon.stub(),
52-
lock: sinon.stub(),
53-
unlock: sinon.stub(),
54-
getSharingKey: sinon.stub(),
55-
ping: sinon.stub(),
56-
authenticate: sinon.stub(),
57-
authenticateWithAccessToken: sinon.stub(),
58-
logout: sinon.stub(),
59-
me: sinon.stub(),
60-
session: sinon.stub(),
61-
getUser: sinon.stub(),
62-
users: sinon.stub(),
63-
getWallet: sinon.stub(),
64-
getWallets: sinon.stub(),
65-
addWallet: sinon.stub(),
66-
removeWallet: sinon.stub(),
67-
getAsUser: sinon.stub(),
68-
register: sinon.stub(),
69-
} as unknown as BitGoAPI;
39+
mockBitgo = new BitGoAPI({ env: 'test' });
7040

7141
// Setup middleware stubs before creating app
7242
sinon.stub(middleware, 'prepareBitGo').callsFake(() => (req, res, next) => {
@@ -98,7 +68,7 @@ describe('Non Recovery Tests', () => {
9868
});
9969
});
10070

101-
it('should fail to run recovery if not in recovery mode', async () => {
71+
it('should fail to run mbe recovery if not in recovery mode', async () => {
10272
const coin = 'tbtc';
10373
const userPub = 'xpub_user';
10474
const backupPub = 'xpub_backup';
@@ -134,7 +104,7 @@ describe('Non Recovery Tests', () => {
134104
});
135105

136106
describe('Recovery Consolidation', () => {
137-
it('should fail to run recovery consolidation if not in recovery mode', async () => {
107+
it('should fail to run mbe recovery consolidation if not in recovery mode', async () => {
138108
const response = await agent
139109
.post(`/api/trx/wallet/recoveryconsolidations`)
140110
.set('Authorization', `Bearer ${accessToken}`)

src/__tests__/config.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ describe('Configuration', () => {
7575
}
7676
});
7777

78-
it('should read the recovery mode from the env', () => {
79-
process.env.RECOVERY_MODE = 'true';
80-
const cfg = initConfig();
81-
cfg.recoveryMode!.should.be.true();
82-
});
83-
8478
it('should read port from environment variable', () => {
8579
process.env.ENCLAVED_EXPRESS_PORT = '4000';
8680
process.env.KMS_URL = 'http://localhost:3000';
@@ -96,6 +90,15 @@ describe('Configuration', () => {
9690
}
9791
});
9892

93+
it('should read the recovery mode from the env', () => {
94+
process.env.KMS_URL = 'http://localhost:3000';
95+
process.env.TLS_KEY = mockTlsKey;
96+
process.env.TLS_CERT = mockTlsCert;
97+
process.env.RECOVERY_MODE = 'true';
98+
const cfg = initConfig();
99+
cfg.recoveryMode!.should.be.true();
100+
});
101+
99102
it('should read TLS mode from environment variables', () => {
100103
process.env.KMS_URL = 'http://localhost:3000';
101104
process.env.TLS_KEY = mockTlsKey;

0 commit comments

Comments
 (0)