Remove startServer method as it now does nothing
This commit is contained in:
@@ -12,30 +12,18 @@ import { getDirectoryNamesInsidePath } from "../files";
|
||||
* Enables mocking of the GitHub API server via HTTP interception, using msw.
|
||||
*/
|
||||
export class MockGitHubApiServer extends DisposableObject {
|
||||
private _isListening: boolean;
|
||||
|
||||
private readonly server: SetupServer;
|
||||
private readonly recorder: Recorder;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this._isListening = false;
|
||||
|
||||
this.server = setupServer();
|
||||
this.recorder = this.push(new Recorder(this.server));
|
||||
}
|
||||
|
||||
public startServer(): void {
|
||||
if (this._isListening) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._isListening = true;
|
||||
}
|
||||
|
||||
public stopServer(): void {
|
||||
this.server.close();
|
||||
this._isListening = false;
|
||||
}
|
||||
|
||||
public async loadScenario(
|
||||
@@ -111,10 +99,6 @@ export class MockGitHubApiServer extends DisposableObject {
|
||||
return await getDirectoryNamesInsidePath(scenariosPath);
|
||||
}
|
||||
|
||||
public get isListening(): boolean {
|
||||
return this._isListening;
|
||||
}
|
||||
|
||||
public get isRecording(): boolean {
|
||||
return this.recorder.isRecording;
|
||||
}
|
||||
|
||||
@@ -42,10 +42,6 @@ export class VSCodeMockGitHubApiServer extends DisposableObject {
|
||||
};
|
||||
}
|
||||
|
||||
public async startServer(): Promise<void> {
|
||||
this.server.startServer();
|
||||
}
|
||||
|
||||
public async stopServer(): Promise<void> {
|
||||
this.server.stopServer();
|
||||
|
||||
@@ -256,9 +252,7 @@ export class VSCodeMockGitHubApiServer extends DisposableObject {
|
||||
}
|
||||
|
||||
private async onConfigChange(): Promise<void> {
|
||||
if (this.config.mockServerEnabled && !this.server.isListening) {
|
||||
await this.startServer();
|
||||
} else if (!this.config.mockServerEnabled && this.server.isListening) {
|
||||
if (!this.config.mockServerEnabled) {
|
||||
await this.stopServer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { response as variantAnalysisRepoJson_response } from "../../../../src/co
|
||||
import { testCredentialsWithRealOctokit } from "../../../factories/authentication";
|
||||
|
||||
const mockServer = new MockGitHubApiServer();
|
||||
beforeAll(() => mockServer.startServer());
|
||||
afterEach(() => mockServer.unloadScenario());
|
||||
afterAll(() => mockServer.stopServer());
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import { createVSCodeCommandManager } from "../../../../src/common/vscode/comman
|
||||
import { AllCommands } from "../../../../src/common/commands";
|
||||
|
||||
const mockServer = new MockGitHubApiServer();
|
||||
beforeAll(() => mockServer.startServer());
|
||||
afterEach(() => mockServer.unloadScenario());
|
||||
afterAll(() => mockServer.stopServer());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user