Skip to content

Commit b8b9d03

Browse files
committed
fix: apply TypeScript linter checks
1 parent 7cbc5c4 commit b8b9d03

File tree

7 files changed

+27
-6
lines changed

7 files changed

+27
-6
lines changed

src/features/organizations/__test__/test-helpers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AzureDevOpsConfig } from '../../../shared/types';
1+
import { AzureDevOpsConfig, TransportProtocol } from '../../../shared/types';
22
import { AuthenticationMethod } from '../../../shared/auth';
33

44
/**
@@ -17,6 +17,8 @@ export function getTestConfig(): AzureDevOpsConfig | null {
1717
authMethod: AuthenticationMethod.PersonalAccessToken,
1818
personalAccessToken: pat,
1919
defaultProject: process.env.AZURE_DEVOPS_DEFAULT_PROJECT,
20+
transport: TransportProtocol.Stdio,
21+
http_port: 8000,
2022
};
2123
}
2224

src/features/organizations/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
RequestHandler,
1616
} from '../../shared/types/request-handler';
1717
import { listOrganizations } from './list-organizations';
18-
import { AzureDevOpsConfig } from '../../shared/types';
18+
import { AzureDevOpsConfig, TransportProtocol } from '../../shared/types';
1919
import { AuthenticationMethod } from '../../shared/auth';
2020

2121
/**
@@ -49,6 +49,8 @@ export const handleOrganizationsRequest: RequestHandler = async (
4949
: AuthenticationMethod.AzureIdentity,
5050
personalAccessToken: process.env.AZURE_DEVOPS_PAT,
5151
organizationUrl: connection.serverUrl || '',
52+
transport: TransportProtocol.Stdio,
53+
http_port: 8000,
5254
};
5355

5456
const result = await listOrganizations(config);

src/features/organizations/list-organizations/feature.spec.unit.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { listOrganizations } from './feature';
22
import { AzureDevOpsAuthenticationError } from '../../../shared/errors';
33
import axios from 'axios';
44
import { AuthenticationMethod } from '../../../shared/auth';
5+
import { TransportProtocol } from '@/shared/types';
56

67
// Mock axios
78
jest.mock('axios');
@@ -27,6 +28,8 @@ describe('listOrganizations unit', () => {
2728
const config = {
2829
organizationUrl: 'https://dev.azure.com/test-org',
2930
authMethod: AuthenticationMethod.PersonalAccessToken,
31+
transport: TransportProtocol.Stdio,
32+
http_port: 8000,
3033
// No PAT provided
3134
};
3235

@@ -45,6 +48,8 @@ describe('listOrganizations unit', () => {
4548
organizationUrl: 'https://dev.azure.com/test-org',
4649
authMethod: AuthenticationMethod.PersonalAccessToken,
4750
personalAccessToken: 'test-pat',
51+
transport: TransportProtocol.Stdio,
52+
http_port: 8000,
4853
};
4954

5055
// Mock axios to throw an error with properties expected by axios.isAxiosError
@@ -78,6 +83,8 @@ describe('listOrganizations unit', () => {
7883
organizationUrl: 'https://dev.azure.com/test-org',
7984
authMethod: AuthenticationMethod.PersonalAccessToken,
8085
personalAccessToken: 'test-pat',
86+
transport: TransportProtocol.Stdio,
87+
http_port: 8000,
8188
};
8289

8390
// Mock profile API response

src/features/repositories/get-all-repositories-tree/feature.spec.int.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getConnection } from '../../../server';
22
import { shouldSkipIntegrationTest } from '../../../shared/test/test-helpers';
33
import { getAllRepositoriesTree } from './feature';
4-
import { AzureDevOpsConfig } from '../../../shared/types';
4+
import { AzureDevOpsConfig, TransportProtocol } from '../../../shared/types';
55
import { WebApi } from 'azure-devops-node-api';
66
import { AuthenticationMethod } from '../../../shared/auth';
77

@@ -26,6 +26,8 @@ describeOrSkip('getAllRepositoriesTree (Integration)', () => {
2626
authMethod: AuthenticationMethod.PersonalAccessToken,
2727
personalAccessToken: process.env.AZURE_DEVOPS_PAT || '',
2828
defaultProject: process.env.AZURE_DEVOPS_DEFAULT_PROJECT || '',
29+
transport: TransportProtocol.Stdio,
30+
http_port: 8000,
2931
};
3032

3133
// Use test project - should be defined in .env file

src/features/repositories/get-file-content/feature.spec.int.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getConnection } from '../../../server';
22
import { shouldSkipIntegrationTest } from '../../../shared/test/test-helpers';
33
import { getFileContent } from './feature';
44
import { GitVersionType } from 'azure-devops-node-api/interfaces/GitInterfaces';
5-
import { AzureDevOpsConfig } from '../../../shared/types';
5+
import { AzureDevOpsConfig, TransportProtocol } from '../../../shared/types';
66
import { WebApi } from 'azure-devops-node-api';
77
import { AuthenticationMethod } from '../../../shared/auth';
88

@@ -28,6 +28,8 @@ describeOrSkip('getFileContent (Integration)', () => {
2828
authMethod: AuthenticationMethod.PersonalAccessToken,
2929
personalAccessToken: process.env.AZURE_DEVOPS_PAT || '',
3030
defaultProject: process.env.AZURE_DEVOPS_DEFAULT_PROJECT || '',
31+
transport: TransportProtocol.Stdio,
32+
http_port: 8000,
3133
};
3234

3335
// Use a test repository/project - should be defined in .env file

src/features/search/search-work-items/feature.spec.int.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { WebApi } from 'azure-devops-node-api';
22
import { searchWorkItems } from './feature';
33
import { getConnection } from '../../../server';
4-
import { AzureDevOpsConfig } from '../../../shared/types';
4+
import { AzureDevOpsConfig, TransportProtocol } from '../../../shared/types';
55
import { AuthenticationMethod } from '../../../shared/auth';
66

77
// Skip tests if no PAT is available
@@ -20,6 +20,8 @@ describeOrSkip('searchWorkItems (Integration)', () => {
2020
authMethod: AuthenticationMethod.PersonalAccessToken,
2121
personalAccessToken: process.env.AZURE_DEVOPS_PAT || '',
2222
defaultProject: process.env.AZURE_DEVOPS_DEFAULT_PROJECT || '',
23+
transport: TransportProtocol.Stdio,
24+
http_port: 8000,
2325
};
2426

2527
connection = await getConnection(config);
@@ -186,6 +188,8 @@ describeOrSkip('searchWorkItems (Integration)', () => {
186188
organizationUrl: process.env.AZURE_DEVOPS_ORG_URL,
187189
authMethod: AuthenticationMethod.AzureIdentity,
188190
defaultProject: process.env.TEST_PROJECT_ID,
191+
transport: TransportProtocol.Stdio,
192+
http_port: 8000,
189193
};
190194

191195
// Create the connection using the config

src/shared/test/test-helpers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { WebApi } from 'azure-devops-node-api';
22
import { getPersonalAccessTokenHandler } from 'azure-devops-node-api';
3-
import { AzureDevOpsConfig } from '../types';
3+
import { AzureDevOpsConfig, TransportProtocol } from '../types';
44
import { AuthenticationMethod } from '../auth';
55

66
/**
@@ -38,6 +38,8 @@ export function getTestConfig(): AzureDevOpsConfig | null {
3838
authMethod: AuthenticationMethod.PersonalAccessToken,
3939
personalAccessToken: pat,
4040
defaultProject: process.env.AZURE_DEVOPS_DEFAULT_PROJECT,
41+
transport: TransportProtocol.Stdio,
42+
http_port: 8000,
4143
};
4244
}
4345

0 commit comments

Comments
 (0)