Skip to content

Commit 8d2c69b

Browse files
committed
chore: format
1 parent 8566f2a commit 8d2c69b

File tree

2 files changed

+37
-39
lines changed

2 files changed

+37
-39
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ Otherwise, if you have a deeper query or require more support, please [raise an
120120

121121
🤝 Join our [fortnightly Zoom meeting](https://zoom-lfx.platform.linuxfoundation.org/meeting/95849833904?password=99413314-d03a-4b1c-b682-1ede2c399595) on Monday, 4PM BST (odd week numbers).
122122
🌍 [Convert to your local time](https://www.timeanddate.com/worldclock)
123-
📅 [Click here](https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=MTRvbzM0NG01dWNvNGc4OGJjNWphM2ZtaTZfMjAyNTA2MDJUMTUwMDAwWiBzYW0uaG9sbWVzQGNvbnRyb2wtcGxhbmUuaW8&tmsrc=sam.holmes%40control-plane.io&scp=ALL) for the recurring Google Calendar meeting invite. Alternatively, send an e-mail to [help@finos.org](https://zoom-lfx.platform.linuxfoundation.org/meeting/95849833904?password=99413314-d03a-4b1c-b682-1ede2c399595#:~:text=Need-,an,-invite%3F) to get a calendar invitation.
123+
📅 [Click here](https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=MTRvbzM0NG01dWNvNGc4OGJjNWphM2ZtaTZfMjAyNTA2MDJUMTUwMDAwWiBzYW0uaG9sbWVzQGNvbnRyb2wtcGxhbmUuaW8&tmsrc=sam.holmes%40control-plane.io&scp=ALL) for the recurring Google Calendar meeting invite. Alternatively, send an e-mail to [help@finos.org](https://zoom-lfx.platform.linuxfoundation.org/meeting/95849833904?password=99413314-d03a-4b1c-b682-1ede2c399595#:~:text=Need-,an,-invite%3F) to get a calendar invitation.

test/testProxy.test.js

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('Proxy', () => {
2323
close: sandbox.stub().callsFake((callback) => {
2424
if (callback) setImmediate(callback);
2525
return mockHttpServer;
26-
})
26+
}),
2727
};
2828

2929
mockHttpsServer = {
@@ -34,7 +34,7 @@ describe('Proxy', () => {
3434
close: sandbox.stub().callsFake((callback) => {
3535
if (callback) setImmediate(callback);
3636
return mockHttpsServer;
37-
})
37+
}),
3838
};
3939

4040
sandbox.stub(http, 'createServer').returns(mockHttpServer);
@@ -49,40 +49,38 @@ describe('Proxy', () => {
4949

5050
Proxy = proxyquire('../src/proxy/index', {
5151
'./routes': {
52-
getRouter: sandbox.stub().resolves(mockRouter)
52+
getRouter: sandbox.stub().resolves(mockRouter),
5353
},
5454
'../config': {
5555
getTLSEnabled: sandbox.stub().returns(false),
5656
getTLSKeyPemPath: sandbox.stub().returns('/tmp/key.pem'),
5757
getTLSCertPemPath: sandbox.stub().returns('/tmp/cert.pem'),
5858
getPlugins: sandbox.stub().returns(['mock-plugin']),
59-
getAuthorisedList: sandbox.stub().returns([
60-
{ project: 'test-proj', name: 'test-repo' }
61-
])
59+
getAuthorisedList: sandbox.stub().returns([{ project: 'test-proj', name: 'test-repo' }]),
6260
},
6361
'../db': {
6462
getRepos: sandbox.stub().resolves([]),
6563
createRepo: sandbox.stub().resolves({ _id: 'mock-repo-id' }),
6664
addUserCanPush: sandbox.stub().resolves(),
67-
addUserCanAuthorise: sandbox.stub().resolves()
65+
addUserCanAuthorise: sandbox.stub().resolves(),
6866
},
6967
'../plugin': {
7068
PluginLoader: sandbox.stub().returns({
71-
load: sandbox.stub().resolves()
72-
})
69+
load: sandbox.stub().resolves(),
70+
}),
7371
},
7472
'./chain': {
75-
default: {}
73+
default: {},
7674
},
7775
'../config/env': {
7876
serverConfig: {
7977
GIT_PROXY_SERVER_PORT: 3000,
80-
GIT_PROXY_HTTPS_SERVER_PORT: 3001
81-
}
78+
GIT_PROXY_HTTPS_SERVER_PORT: 3001,
79+
},
80+
},
81+
fs: {
82+
readFileSync: sandbox.stub().returns(Buffer.from('mock-cert')),
8283
},
83-
'fs': {
84-
readFileSync: sandbox.stub().returns(Buffer.from('mock-cert'))
85-
}
8684
}).default;
8785
});
8886

@@ -112,38 +110,38 @@ describe('Proxy', () => {
112110

113111
const ProxyWithTLS = proxyquire('../src/proxy/index', {
114112
'./routes': {
115-
getRouter: sandbox.stub().resolves(mockRouterTLS)
113+
getRouter: sandbox.stub().resolves(mockRouterTLS),
116114
},
117115
'../config': {
118116
getTLSEnabled: sandbox.stub().returns(true), // TLS enabled
119117
getTLSKeyPemPath: sandbox.stub().returns('/tmp/key.pem'),
120118
getTLSCertPemPath: sandbox.stub().returns('/tmp/cert.pem'),
121119
getPlugins: sandbox.stub().returns(['mock-plugin']),
122-
getAuthorisedList: sandbox.stub().returns([])
120+
getAuthorisedList: sandbox.stub().returns([]),
123121
},
124122
'../db': {
125123
getRepos: sandbox.stub().resolves([]),
126124
createRepo: sandbox.stub().resolves({ _id: 'mock-repo-id' }),
127125
addUserCanPush: sandbox.stub().resolves(),
128-
addUserCanAuthorise: sandbox.stub().resolves()
126+
addUserCanAuthorise: sandbox.stub().resolves(),
129127
},
130128
'../plugin': {
131129
PluginLoader: sandbox.stub().returns({
132-
load: sandbox.stub().resolves()
133-
})
130+
load: sandbox.stub().resolves(),
131+
}),
134132
},
135133
'./chain': {
136-
default: {}
134+
default: {},
137135
},
138136
'../config/env': {
139137
serverConfig: {
140138
GIT_PROXY_SERVER_PORT: 3000,
141-
GIT_PROXY_HTTPS_SERVER_PORT: 3001
142-
}
139+
GIT_PROXY_HTTPS_SERVER_PORT: 3001,
140+
},
141+
},
142+
fs: {
143+
readFileSync: sandbox.stub().returns(Buffer.from('mock-cert')),
143144
},
144-
'fs': {
145-
readFileSync: sandbox.stub().returns(Buffer.from('mock-cert'))
146-
}
147145
}).default;
148146

149147
const proxy = new ProxyWithTLS();
@@ -210,38 +208,38 @@ describe('Proxy', () => {
210208

211209
const ProxyWithTLS = proxyquire('../src/proxy/index', {
212210
'./routes': {
213-
getRouter: sandbox.stub().resolves(mockRouterStop)
211+
getRouter: sandbox.stub().resolves(mockRouterStop),
214212
},
215213
'../config': {
216214
getTLSEnabled: sandbox.stub().returns(true),
217215
getTLSKeyPemPath: sandbox.stub().returns('/tmp/key.pem'),
218216
getTLSCertPemPath: sandbox.stub().returns('/tmp/cert.pem'),
219217
getPlugins: sandbox.stub().returns([]),
220-
getAuthorisedList: sandbox.stub().returns([])
218+
getAuthorisedList: sandbox.stub().returns([]),
221219
},
222220
'../db': {
223221
getRepos: sandbox.stub().resolves([]),
224222
createRepo: sandbox.stub().resolves({ _id: 'mock-repo-id' }),
225223
addUserCanPush: sandbox.stub().resolves(),
226-
addUserCanAuthorise: sandbox.stub().resolves()
224+
addUserCanAuthorise: sandbox.stub().resolves(),
227225
},
228226
'../plugin': {
229227
PluginLoader: sandbox.stub().returns({
230-
load: sandbox.stub().resolves()
231-
})
228+
load: sandbox.stub().resolves(),
229+
}),
232230
},
233231
'./chain': {
234-
default: {}
232+
default: {},
235233
},
236234
'../config/env': {
237235
serverConfig: {
238236
GIT_PROXY_SERVER_PORT: 3000,
239-
GIT_PROXY_HTTPS_SERVER_PORT: 3001
240-
}
237+
GIT_PROXY_HTTPS_SERVER_PORT: 3001,
238+
},
239+
},
240+
fs: {
241+
readFileSync: sandbox.stub().returns(Buffer.from('mock-cert')),
241242
},
242-
'fs': {
243-
readFileSync: sandbox.stub().returns(Buffer.from('mock-cert'))
244-
}
245243
}).default;
246244

247245
const proxy = new ProxyWithTLS();
@@ -302,7 +300,7 @@ describe('Proxy', () => {
302300

303301
await proxy.start();
304302
await proxy.stop();
305-
303+
306304
expect(mockHttpServer.listen.calledOnce).to.be.true;
307305
expect(mockHttpServer.close.calledOnce).to.be.true;
308306
});

0 commit comments

Comments
 (0)