Skip to content

Commit

Permalink
Remove adding summary to run (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
katydecorah authored May 25, 2024
1 parent b4ddbfb commit 48b119e
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 586 deletions.
192 changes: 0 additions & 192 deletions src/__tests__/summary.test.ts

This file was deleted.

43 changes: 0 additions & 43 deletions src/__tests__/workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe("workflow", () => {

test("want to read", async () => {
jest.spyOn(promises, "readFile").mockResolvedValue();
const summarySpy = jest.spyOn(core.summary, "addRaw");
jest.useFakeTimers().setSystemTime(new Date("2022-10-01T12:00:00"));
const setFailedSpy = jest.spyOn(core, "setFailed");
Object.defineProperty(github, "context", {
Expand All @@ -56,15 +55,6 @@ describe("workflow", () => {
});
await read();
expect(setFailedSpy).not.toHaveBeenCalled();
expect(summarySpy.mock.calls[0]).toMatchInlineSnapshot(`
[
"# Updated library
Want to read: “Luster”
",
]
`);
expect(returnWriteFile.mock.calls[0]).toMatchInlineSnapshot(`
[
"my-library.json",
Expand Down Expand Up @@ -121,7 +111,6 @@ describe("workflow", () => {
])
);
const setFailedSpy = jest.spyOn(core, "setFailed");
const summarySpy = jest.spyOn(core.summary, "addRaw");
Object.defineProperty(github, "context", {
value: {
payload: {
Expand All @@ -135,15 +124,6 @@ describe("workflow", () => {
});
await read();
expect(setFailedSpy).not.toHaveBeenCalled();
expect(summarySpy.mock.calls[0]).toMatchInlineSnapshot(`
[
"# Updated library
Started: “Luster”
",
]
`);
expect(returnWriteFile.mock.calls[0]).toMatchInlineSnapshot(`
[
"my-library.json",
Expand Down Expand Up @@ -196,7 +176,6 @@ describe("workflow", () => {
])
);
const setFailedSpy = jest.spyOn(core, "setFailed");
const summarySpy = jest.spyOn(core.summary, "addRaw");
Object.defineProperty(github, "context", {
value: {
payload: {
Expand All @@ -212,18 +191,6 @@ describe("workflow", () => {
await read();

expect(setFailedSpy).not.toHaveBeenCalled();
expect(summarySpy.mock.calls[0]).toMatchInlineSnapshot(`
[
"# Updated library
Finished: “Luster”
## 2022 reading summary
- **Total books:** 1
",
]
`);
expect(returnWriteFile.mock.calls[0]).toMatchInlineSnapshot(`
[
"my-library.json",
Expand Down Expand Up @@ -256,7 +223,6 @@ describe("workflow", () => {
test("missing thumbnail", async () => {
jest.spyOn(promises, "readFile").mockResolvedValue(JSON.stringify([]));
const setFailedSpy = jest.spyOn(core, "setFailed");
const summarySpy = jest.spyOn(core.summary, "addRaw");
const exportVariableSpy = jest.spyOn(core, "exportVariable");

Object.defineProperty(github, "context", {
Expand All @@ -272,15 +238,6 @@ describe("workflow", () => {
await read();

expect(setFailedSpy).not.toHaveBeenCalled();
expect(summarySpy.mock.calls[0]).toMatchInlineSnapshot(`
[
"# Updated library
Want to read: “Don't Let Her Stay”
",
]
`);
expect(returnWriteFile.mock.calls[0]).toMatchInlineSnapshot(`
[
"my-library.json",
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { exportVariable, getInput, setFailed, summary } from "@actions/core";
import { exportVariable, getInput, setFailed } from "@actions/core";
import * as github from "@actions/github";
import Isbn from "@library-pals/isbn";
import returnWriteFile from "./write-file";
import { getBookStatus, sortByDate, toArray } from "./utils";
import { checkOutBook } from "./checkout-book";
import { BookStatus } from "./clean-book";
import { summaryMarkdown } from "./summary";
import returnReadFile from "./read-file";
import { updateBook } from "./update-book";
import { validatePayload } from "./validate-payload";
Expand Down Expand Up @@ -106,7 +105,6 @@ export async function read() {
library = sortByDate(library);

await returnWriteFile(filename, library);
await summary.addRaw(summaryMarkdown(library, date, bookStatus)).write();
} catch (error) {
setFailed(error);
}
Expand Down
83 changes: 0 additions & 83 deletions src/summary-markdown.ts

This file was deleted.

Loading

0 comments on commit 48b119e

Please sign in to comment.