-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update example-ts to latest github-actions version
- Loading branch information
Showing
6 changed files
with
64 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const createConfig = require("@kcws/eslint-config"); | ||
const createConfig = require("@kcws/eslint-config") | ||
module.exports = createConfig({ | ||
cwd: __dirname, | ||
profile: "node", | ||
jest: true, | ||
prettier: true, | ||
ecma: "latest", | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
jest.mock("@actions/core") | ||
|
||
import { info } from "@actions/core" | ||
|
||
import app from "../app" | ||
import app, { context } from "../app" | ||
import runner from "./main" | ||
|
||
describe("application runner", () => { | ||
test("should print info logs with default value", async () => { | ||
jest.spyOn(context.plugins.log, "info") | ||
|
||
await app.exec(runner) | ||
|
||
expect(info).toHaveBeenCalled() | ||
expect(info).toHaveBeenLastCalledWith("hello world") | ||
expect(context.plugins.log.info).toHaveBeenCalledTimes(2) | ||
}) | ||
|
||
test("should print info logs with custom value", async () => { | ||
jest.spyOn(context.plugins.log, "info") | ||
|
||
await app.exec(runner, { name: "name" }) | ||
|
||
expect(info).toHaveBeenCalled() | ||
expect(info).toHaveBeenLastCalledWith("hello name") | ||
expect(context.plugins.log.info).toHaveBeenCalledTimes(2) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
jest.mock("@actions/core") | ||
|
||
import { info } from "@actions/core" | ||
|
||
import app from "../app" | ||
import app, { context } from "../app" | ||
import runner from "./post" | ||
|
||
describe("[post-hook] application runner", () => { | ||
test("should print info logs", async () => { | ||
jest.spyOn(context.plugins.log, "info") | ||
|
||
app.exec(runner) | ||
expect(info).toHaveBeenCalledTimes(1) | ||
expect(info).toHaveBeenCalledWith("hello post world") | ||
expect(context.plugins.log.info).toHaveBeenCalledTimes(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
jest.mock("@actions/core") | ||
|
||
import { info } from "@actions/core" | ||
|
||
import app from "../app" | ||
import app, { context } from "../app" | ||
import runner from "./pre" | ||
|
||
describe("[pre-hook] application runner", () => { | ||
test("should print info logs", async () => { | ||
jest.spyOn(context.plugins.log, "info") | ||
|
||
app.exec(runner) | ||
expect(info).toHaveBeenCalledTimes(1) | ||
expect(info).toHaveBeenCalledWith("hello pre world") | ||
expect(context.plugins.log.info).toHaveBeenCalledTimes(1) | ||
}) | ||
}) |
Oops, something went wrong.