Skip to content

Commit ffc90a0

Browse files
robertbrignullkoesie10
authored andcommitted
Remove startServer method as it now does nothing
1 parent e34f4ed commit ffc90a0

4 files changed

Lines changed: 1 addition & 25 deletions

File tree

extensions/ql-vscode/src/common/mock-gh-api/mock-gh-api-server.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,18 @@ import { getDirectoryNamesInsidePath } from "../files";
1212
* Enables mocking of the GitHub API server via HTTP interception, using msw.
1313
*/
1414
export class MockGitHubApiServer extends DisposableObject {
15-
private _isListening: boolean;
16-
1715
private readonly server: SetupServer;
1816
private readonly recorder: Recorder;
1917

2018
constructor() {
2119
super();
22-
this._isListening = false;
2320

2421
this.server = setupServer();
2522
this.recorder = this.push(new Recorder(this.server));
2623
}
2724

28-
public startServer(): void {
29-
if (this._isListening) {
30-
return;
31-
}
32-
33-
this._isListening = true;
34-
}
35-
3625
public stopServer(): void {
3726
this.server.close();
38-
this._isListening = false;
3927
}
4028

4129
public async loadScenario(
@@ -111,10 +99,6 @@ export class MockGitHubApiServer extends DisposableObject {
11199
return await getDirectoryNamesInsidePath(scenariosPath);
112100
}
113101

114-
public get isListening(): boolean {
115-
return this._isListening;
116-
}
117-
118102
public get isRecording(): boolean {
119103
return this.recorder.isRecording;
120104
}

extensions/ql-vscode/src/common/mock-gh-api/vscode/vscode-mock-gh-api-server.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ export class VSCodeMockGitHubApiServer extends DisposableObject {
4242
};
4343
}
4444

45-
public async startServer(): Promise<void> {
46-
this.server.startServer();
47-
}
48-
4945
public async stopServer(): Promise<void> {
5046
this.server.stopServer();
5147

@@ -256,9 +252,7 @@ export class VSCodeMockGitHubApiServer extends DisposableObject {
256252
}
257253

258254
private async onConfigChange(): Promise<void> {
259-
if (this.config.mockServerEnabled && !this.server.isListening) {
260-
await this.startServer();
261-
} else if (!this.config.mockServerEnabled && this.server.isListening) {
255+
if (!this.config.mockServerEnabled) {
262256
await this.stopServer();
263257
}
264258
}

extensions/ql-vscode/test/unit-tests/variant-analysis/gh-api/gh-api-client.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { response as variantAnalysisRepoJson_response } from "../../../../src/co
1313
import { testCredentialsWithRealOctokit } from "../../../factories/authentication";
1414

1515
const mockServer = new MockGitHubApiServer();
16-
beforeAll(() => mockServer.startServer());
1716
afterEach(() => mockServer.unloadScenario());
1817
afterAll(() => mockServer.stopServer());
1918

extensions/ql-vscode/test/vscode-tests/cli-integration/variant-analysis/variant-analysis-submission-integration.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { createVSCodeCommandManager } from "../../../../src/common/vscode/comman
1616
import { AllCommands } from "../../../../src/common/commands";
1717

1818
const mockServer = new MockGitHubApiServer();
19-
beforeAll(() => mockServer.startServer());
2019
afterEach(() => mockServer.unloadScenario());
2120
afterAll(() => mockServer.stopServer());
2221

0 commit comments

Comments
 (0)