|
| 1 | +/** |
| 2 | + * Copyright (c) 2024 Gitpod GmbH. All rights reserved. |
| 3 | + * Licensed under the GNU Affero General Public License (AGPL). |
| 4 | + * See License.AGPL.txt in the project root for license information. |
| 5 | + */ |
| 6 | + |
| 7 | +import { User } from "@gitpod/gitpod-protocol"; |
| 8 | +import { ifEnvVarNotSet } from "@gitpod/gitpod-protocol/lib/util/skip-if"; |
| 9 | +import { expect } from "chai"; |
| 10 | +import { Container } from "inversify"; |
| 11 | +import { suite, test, timeout, skip } from "@testdeck/mocha"; |
| 12 | +import { DevData, DevTestHelper } from "../dev/dev-data"; |
| 13 | +import { AzureDevOpsApi } from "./azure-api"; |
| 14 | + |
| 15 | +DevTestHelper.echoAzureTestTips(); |
| 16 | + |
| 17 | +@suite(timeout(10000), skip(ifEnvVarNotSet(DevTestHelper.AzureTestEnv))) |
| 18 | +class TestAzureDevOpsFileProvider { |
| 19 | + protected azureDevOpsApi: AzureDevOpsApi; |
| 20 | + protected user: User; |
| 21 | + protected container: Container; |
| 22 | + |
| 23 | + public before() { |
| 24 | + this.container = DevTestHelper.createAzureSCMContainer(); |
| 25 | + this.azureDevOpsApi = this.container.get(AzureDevOpsApi); |
| 26 | + this.user = DevData.createTestUser(); |
| 27 | + } |
| 28 | + |
| 29 | + @test public async happyPath() { |
| 30 | + const result = await this.azureDevOpsApi.getRepository(this.user, "services-azure", "test-project", "repo2"); |
| 31 | + expect(result.name).to.equal("repo2"); |
| 32 | + } |
| 33 | +} |
| 34 | + |
| 35 | +module.exports = new TestAzureDevOpsFileProvider(); |
0 commit comments