Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fflorent committed Nov 5, 2024
1 parent 51b9ee6 commit cb593da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/server/lib/DocApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ describe('DocApi', function () {

proxy.requireFromOutsideHeader();

await proxy.start(home, docs);
proxy.start(home, docs);

homeUrl = serverUrl = proxy.serverUrl;
hasHomeApi = true;
Expand Down
5 changes: 2 additions & 3 deletions test/server/lib/Webhooks-Proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ describe('Webhooks-Proxy', function () {
describe("should work with a home server and a docworker", async () => {
setupMockServers('separated', tmpDir, async () => {
home = await TestServer.startServer('home', tmpDir, suitename, additionaEnvConfiguration);
const homeUrl = home.serverUrl;
docs = await TestServer.startServer('docs', tmpDir, suitename, additionaEnvConfiguration, homeUrl);
serverUrl = homeUrl;
docs = await TestServer.startServer('docs', tmpDir, suitename, additionaEnvConfiguration, home.serverUrl);
serverUrl = home.serverUrl;
});
subTestCall();
});
Expand Down
8 changes: 4 additions & 4 deletions test/server/lib/helpers/TestServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ export class TestServerReverseProxy {
this._requireFromOutsideHeader = true;
}

public async start(homeServer: TestServer, docServer: TestServer) {
this._app.all(['/dw/dw1', '/dw/dw1/*'], await this._getRequestHandlerFor(docServer));
this._app.all('/*', await this._getRequestHandlerFor(homeServer));
public start(homeServer: TestServer, docServer: TestServer) {
this._app.all(['/dw/dw1', '/dw/dw1/*'], this._getRequestHandlerFor(docServer));
this._app.all('/*', this._getRequestHandlerFor(homeServer));

// Forbid now the use of serverUrl property, so we don't allow the tests to
// call the workers directly
Expand All @@ -270,7 +270,7 @@ export class TestServerReverseProxy {
this._proxy.close();
}

private async _getRequestHandlerFor(server: TestServer) {
private _getRequestHandlerFor(server: TestServer) {
const serverUrl = new URL(server.serverUrl);

return (oreq: express.Request, ores: express.Response) => {
Expand Down

0 comments on commit cb593da

Please sign in to comment.