Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
023fa82
feat: use openapi-diff-node for diffing apis
jaychang99 Jul 13, 2024
003d3ac
feat: change font for debugging page
jaychang99 Jul 13, 2024
c7b31f5
feat(Slack): add support for sending diffs to slack channels
jaychang99 Jul 13, 2024
4007a46
fix(Slack): change field type to rich text format due to a set quote …
jaychang99 Jul 13, 2024
ca64d1c
feat(Slack): slack message support for both korean and english, defau…
jaychang99 Jul 13, 2024
f120297
feat(Slack): allow users to input slack user IDs to mention
jaychang99 Jul 13, 2024
9d00646
fix: add locale to github input parameter
jaychang99 Jul 13, 2024
e908f40
feat(Slack): show endpoint in header section
jaychang99 Jul 13, 2024
513a2b4
feat(Slack) assign color and emoji for every possible status
jaychang99 Jul 13, 2024
e60a518
feat(Slack): add colored quote bar in main endpoint message
jaychang99 Jul 13, 2024
e418805
feat(Slack): remove overused emojis
jaychang99 Jul 13, 2024
7146b3c
feat(Slack): re-add bell emoji
jaychang99 Jul 13, 2024
ccee4a3
chore: install openapi-diff-node as a real dependency (instead of npm…
jaychang99 Jul 13, 2024
f931291
feat(Github): different behavior for on_push and on_pull_request
jaychang99 Jul 14, 2024
b67e5b0
feat(Github): rename the result of the diffed markdown from result to…
jaychang99 Jul 14, 2024
ac099c0
feat(Slack): display lastest commit hash and commit message that trig…
jaychang99 Jul 14, 2024
a7a864b
feat(Slack): optionally receive api documentation url to display on s…
jaychang99 Jul 14, 2024
14e5d05
feat(Slack): add repository info in main text
jaychang99 Jul 14, 2024
9cf2b18
feat(Slack): add repository info
jaychang99 Jul 14, 2024
4f34ead
feat(Slack): add type to parameters
jaychang99 Jul 14, 2024
a86765f
style(CSS): change style to comply with prettier settings
jaychang99 Jul 14, 2024
6d84944
test: remove irrelevant tests
jaychang99 Jul 14, 2024
0d1ef4e
dist: build distribution files for 0.2.0
jaychang99 Jul 14, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
# echo outputs from test-action's stdout
- name: Echo Output
id: echo-output
run: echo "${{ steps.test-action.outputs.result }})"
run: echo "${{ steps.test-action.outputs.diff_result }})"

- name: Post comment on PR
uses: peter-evans/create-or-update-comment@v4
Expand Down
105 changes: 58 additions & 47 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/**
* Unit tests for the action's main functionality, src/main.ts
*
Expand Down Expand Up @@ -33,57 +34,67 @@ describe('action', () => {
setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation()
})

it('sets the time output', async () => {
// Set the action's inputs as return values from core.getInput()
getInputMock.mockImplementation(name => {
switch (name) {
case 'milliseconds':
return '500'
default:
return ''
}
})

it('does nothing', async () => {
await main.run()
expect(runMock).toHaveReturned()
// expect(runMock).toHaveReturned()

// Verify that all of the core library functions were called correctly
expect(debugMock).toHaveBeenNthCalledWith(1, 'Waiting 500 milliseconds ...')
expect(debugMock).toHaveBeenNthCalledWith(
2,
expect.stringMatching(timeRegex)
)
expect(debugMock).toHaveBeenNthCalledWith(
3,
expect.stringMatching(timeRegex)
)
expect(setOutputMock).toHaveBeenNthCalledWith(
1,
'time',
expect.stringMatching(timeRegex)
)
expect(errorMock).not.toHaveBeenCalled()
// // Verify that all of the core library functions were called correctly
// expect(debugMock).not.toHaveBeenCalled()
// expect(errorMock).not.toHaveBeenCalled()
// expect(setOutputMock).not.toHaveBeenCalled()
})
// eslint-disable-next-line jest/no-commented-out-tests
// it('sets the time output', async () => {
// // Set the action's inputs as return values from core.getInput()
// getInputMock.mockImplementation(name => {
// switch (name) {
// case 'milliseconds':
// return '500'
// default:
// return ''
// }
// })

it('sets a failed status', async () => {
// Set the action's inputs as return values from core.getInput()
getInputMock.mockImplementation(name => {
switch (name) {
case 'milliseconds':
return 'this is not a number'
default:
return ''
}
})
// await main.run()
// expect(runMock).toHaveReturned()

await main.run()
expect(runMock).toHaveReturned()
// // Verify that all of the core library functions were called correctly
// expect(debugMock).toHaveBeenNthCalledWith(1, 'Waiting 500 milliseconds ...')
// expect(debugMock).toHaveBeenNthCalledWith(
// 2,
// expect.stringMatching(timeRegex)
// )
// expect(debugMock).toHaveBeenNthCalledWith(
// 3,
// expect.stringMatching(timeRegex)
// )
// expect(setOutputMock).toHaveBeenNthCalledWith(
// 1,
// 'time',
// expect.stringMatching(timeRegex)
// )
// expect(errorMock).not.toHaveBeenCalled()
// })

// Verify that all of the core library functions were called correctly
expect(setFailedMock).toHaveBeenNthCalledWith(
1,
'milliseconds not a number'
)
expect(errorMock).not.toHaveBeenCalled()
})
// it('sets a failed status', async () => {
// // Set the action's inputs as return values from core.getInput()
// getInputMock.mockImplementation(name => {
// switch (name) {
// case 'milliseconds':
// return 'this is not a number'
// default:
// return ''
// }
// })

// await main.run()
// expect(runMock).toHaveReturned()

// // Verify that all of the core library functions were called correctly
// expect(setFailedMock).toHaveBeenNthCalledWith(
// 1,
// 'milliseconds not a number'
// )
// expect(errorMock).not.toHaveBeenCalled()
// })
})
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions debug/markdown-stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
* {
all: revert;
font-family:
Pretendard,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
'Noto Sans',
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji';

table {
border-spacing: 0 !important;
Expand Down
Loading