Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(azure-devops): report pull request checks #22555

Closedamv146(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/22555/headopened View on GitHub

Showing 6 changed files with 97 additions and 0 deletions (loading 4).

x
0 of 6 viewed, 6 left
38 additions and 0 deletionspackages/source-control-azure-devops/src/server/AzureDevOpsPullRequestCli.test.tsModified
View file
@@ -1432,6 +1432,44 @@
+ it.effect("reads a pull request's policies, and nothing when none apply", () =>
+ Effect.gen(function* () {
+ mockedExecute.mockReturnValueOnce(Effect.succeed(output("")));
+ const cli = yield* AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli;
+​
+ const evaluations = yield* cli.listPolicyEvaluations({ cwd: "/w", number: 42 });
+​
+ expect(evaluations).toEqual([]);
+ expect(argsOfCall(0).slice(0, 4)).toEqual(["repos", "pr", "policy", "list"]);
+ expect(argsOfCall(0)).toContain("42");
+ }),
+ );
+​
+ it.effect("reads only the status fields the checks use", () =>
+ Effect.gen(function* () {
+ mockedExecute.mockReturnValueOnce(
+ Effect.succeed(
+ output(
+ json({
+ value: [{ id: 1, state: "succeeded", description: "Build", context: { name: "ci" } }],
+ }),
+ ),
+ ),
+ );
+ const cli = yield* AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli;
+​