Skip to content

Commit 66c6bf5

Browse files
committed
Rename some variables
1 parent 4636333 commit 66c6bf5

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export class MockGitHubApiServer extends DisposableObject {
6262
}
6363

6464
public async saveScenario(): Promise<void> {
65-
const scenariosDirectory = await this.getScenariosDirectory();
66-
if (!scenariosDirectory) {
65+
const scenariosPath = await this.getScenariosPath();
66+
if (!scenariosPath) {
6767
return;
6868
}
6969

@@ -73,7 +73,7 @@ export class MockGitHubApiServer extends DisposableObject {
7373
void window.showErrorMessage('No scenario is currently being recorded.');
7474
return;
7575
}
76-
if (this.recorder.scenarioRequestCount === 0) {
76+
if (!this.recorder.anyRequestsRecorded) {
7777
void window.showWarningMessage('No requests were recorded. Cancelling scenario.');
7878

7979
await this.stopRecording();
@@ -90,13 +90,13 @@ export class MockGitHubApiServer extends DisposableObject {
9090
return;
9191
}
9292

93-
const filepath = await this.recorder.save(scenariosDirectory, name);
93+
const filePath = await this.recorder.save(scenariosPath, name);
9494

9595
await this.stopRecording();
9696

97-
const action = await window.showInformationMessage(`Scenario saved to ${filepath}`, 'Open directory');
97+
const action = await window.showInformationMessage(`Scenario saved to ${filePath}`, 'Open directory');
9898
if (action === 'Open directory') {
99-
await env.openExternal(Uri.file(filepath));
99+
await env.openExternal(Uri.file(filePath));
100100
}
101101
}
102102

@@ -118,10 +118,10 @@ export class MockGitHubApiServer extends DisposableObject {
118118
await this.recorder.clear();
119119
}
120120

121-
private async getScenariosDirectory(): Promise<string | undefined> {
122-
const scenariosDirectory = getMockGitHubApiServerScenariosPath();
123-
if (scenariosDirectory) {
124-
return scenariosDirectory;
121+
private async getScenariosPath(): Promise<string | undefined> {
122+
const scenariosPath = getMockGitHubApiServerScenariosPath();
123+
if (scenariosPath) {
124+
return scenariosPath;
125125
}
126126

127127
const directories = await window.showOpenDialog({

extensions/ql-vscode/src/mocks/recorder.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class Recorder extends DisposableObject {
2727
return this._recording;
2828
}
2929

30-
public get scenarioRequestCount(): number {
31-
return this.currentRecordedScenario.length;
30+
public get anyRequestsRecorded(): boolean {
31+
return this.currentRecordedScenario.length > 0;
3232
}
3333

3434
public start(): void {
@@ -60,8 +60,8 @@ export class Recorder extends DisposableObject {
6060
this.allRequests.clear();
6161
}
6262

63-
public async save(scenariosDirectory: string, name: string): Promise<string> {
64-
const scenarioDirectory = path.join(scenariosDirectory, name);
63+
public async save(scenariosPath: string, name: string): Promise<string> {
64+
const scenarioDirectory = path.join(scenariosPath, name);
6565

6666
await fs.ensureDir(scenarioDirectory);
6767

0 commit comments

Comments
 (0)