Skip to content

Commit

Permalink
Merge pull request #46 from roryabraham/Rory-UpdateAction
Browse files Browse the repository at this point in the history
Upgrade dependencies, add debug logs
  • Loading branch information
softprops authored Nov 26, 2022
2 parents 1711cd2 + d50d3ff commit ca99add
Show file tree
Hide file tree
Showing 9 changed files with 1,648 additions and 4,117 deletions.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.14.1
16.15.1
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.15.1
21 changes: 14 additions & 7 deletions __tests__/wait.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import * as assert from "assert";

import { Waiter } from "../src/wait";
import { Input } from "../src/input";
import { Workflow, Run } from "../src/github";

describe("wait", () => {
describe("Waiter", () => {
describe("wait", () => {
let input: Input;
const workflow: Workflow = {
const workflow = {
id: 123124,
name: "Test workflow",
};
Expand Down Expand Up @@ -49,11 +48,13 @@ describe("wait", () => {
const messages: Array<string> = [];
const waiter = new Waiter(
workflow.id,
// @ts-ignore
githubClient,
input,
(message: string) => {
messages.push(message);
}
},
() => {}
);
assert.equal(await waiter.wait(), 1);
assert.deepEqual(messages, [
Expand Down Expand Up @@ -83,11 +84,13 @@ describe("wait", () => {
const messages: Array<string> = [];
const waiter = new Waiter(
workflow.id,
// @ts-ignore
githubClient,
input,
(message: string) => {
messages.push(message);
}
},
() => {}
);
await assert.rejects(waiter.wait(), {
name: "Error",
Expand All @@ -100,7 +103,7 @@ describe("wait", () => {
});

it("will return when a run is completed", async () => {
const run: Run = {
const run = {
id: 1,
status: "in_progress",
html_url: "1",
Expand All @@ -119,11 +122,13 @@ describe("wait", () => {
const messages: Array<string> = [];
const waiter = new Waiter(
workflow.id,
// @ts-ignore
githubClient,
input,
(message: string) => {
messages.push(message);
}
},
() => {}
);
await waiter.wait();
assert.deepEqual(messages, ["✋Awaiting run 1 ..."]);
Expand Down Expand Up @@ -177,11 +182,13 @@ describe("wait", () => {
const messages: Array<string> = [];
const waiter = new Waiter(
workflow.id,
// @ts-ignore
githubClient,
input,
(message: string) => {
messages.push(message);
}
},
() => {}
);
await waiter.wait();
// Verify that the last message printed is that the latest previous run
Expand Down
8 changes: 7 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit ca99add

Please sign in to comment.