Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions 上で型検査する #39

Merged
merged 5 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
node-version: "14.x"
- run: npm ci
- run: npm run lint:ci
- name: Type check
uses: gozala/[email protected]
with:
project: functions/tsconfig.json
- name: Create serviceAccountKey.json for online testing
run: echo "$SERVICE_ACCOUNT_KEY_JSON" > ../serviceAccountKey.json
env:
Expand Down
208 changes: 0 additions & 208 deletions functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
},
"devDependencies": {
"@slack-wrench/jest-mock-web-client": "^1.2.0",
"@types/jest": "^26.0.9",
"@types/supertest": "^2.0.10",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
Expand Down
10 changes: 9 additions & 1 deletion functions/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { describe, it, expect } from "@jest/globals";
import {
afterAll,
beforeEach,
afterEach,
describe,
it,
expect,
jest,
} from "@jest/globals";
import {
MockedWebClient,
MockWebClient,
Expand Down
2 changes: 1 addition & 1 deletion functions/src/model/__tests__/rotation.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from "@jest/globals";
import { describe, it, expect, jest } from "@jest/globals";
import { Rotation } from "../rotation";

describe("Rotation", () => {
Expand Down
2 changes: 1 addition & 1 deletion functions/src/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const createSlackApp = (
});
// 型定義上は optional だが、正常系では必ず存在するはず
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return json.members!.reduce<Record<string, string>>(
return json.members.reduce<Record<string, string>>(
Copy link
Owner Author

@mashabow mashabow Sep 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

試しに変更してみたら PR の diff view に annotation が付いた。

GitHub_Actions_上で型検査する_by_mashabow_·_Pull_Request__39_·_mashabow_slack-rota

https://github.com/mashabow/slack-rota/pull/39/files/ca5aea5912b9d89a5996ff0f84036ec1bbde5149..8ef881df6224d78dd78069a9c8ddcd2c1d418fb6#diff-d7add22db7e289142aea1a04d5d5ea6e8f9d2c1e9b31d3189a29d42e5860c299

どこのトークンでエラーになっているのかが表示されないので、そこが若干微妙…

(acc, { id, profile }) => ({
...acc,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down