Skip to content

Commit 3585e95

Browse files
authored
Merge pull request #1380 from mikepenz/feature/upgrade_dev_dependencies
Upgrade dev dependencies
2 parents d307350 + 3630233 commit 3585e95

File tree

4 files changed

+3605
-5045
lines changed

4 files changed

+3605
-5045
lines changed

__tests__/annotator.test.ts

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ describe('attachComment', () => {
2424
// Import context after mocking
2525
const {context} = require('@actions/github/lib/utils.js')
2626
mockContext = context
27-
27+
2828
// Mock core.warning
2929
mockWarning = jest.spyOn(core, 'warning').mockImplementation(() => {})
30-
30+
3131
// Mock octokit
3232
mockOctokit = {
3333
paginate: jest.fn(),
@@ -52,7 +52,10 @@ describe('attachComment', () => {
5252
mockOctokit.paginate.mockResolvedValue([])
5353

5454
const checkName = ['Test Check']
55-
const table = [['Test', 'Result'], ['Example Test', 'Passed']]
55+
const table = [
56+
['Test', 'Result'],
57+
['Example Test', 'Passed']
58+
]
5659
const prId = '123'
5760

5861
await attachComment(mockOctokit, checkName, false, table, [], [], [], prId)
@@ -75,7 +78,10 @@ describe('attachComment', () => {
7578
mockOctokit.paginate.mockResolvedValue([])
7679

7780
const checkName = ['Test Check']
78-
const table = [['Test', 'Result'], ['Example Test', 'Passed']]
81+
const table = [
82+
['Test', 'Result'],
83+
['Example Test', 'Passed']
84+
]
7985

8086
await attachComment(mockOctokit, checkName, false, table, [], [], [])
8187

@@ -95,7 +101,10 @@ describe('attachComment', () => {
95101
mockContext.issue.number = undefined
96102

97103
const checkName = ['Test Check']
98-
const table = [['Test', 'Result'], ['Example Test', 'Passed']]
104+
const table = [
105+
['Test', 'Result'],
106+
['Example Test', 'Passed']
107+
]
99108

100109
await attachComment(mockOctokit, checkName, false, table, [], [], [])
101110

@@ -117,7 +126,10 @@ describe('attachComment', () => {
117126
mockOctokit.paginate.mockResolvedValue([existingComment])
118127

119128
const checkName = ['Test Check']
120-
const table = [['Test', 'Result'], ['Example Test', 'Updated']]
129+
const table = [
130+
['Test', 'Result'],
131+
['Example Test', 'Updated']
132+
]
121133

122134
await attachComment(mockOctokit, checkName, true, table, [], [], [])
123135

@@ -135,7 +147,10 @@ describe('attachComment', () => {
135147
mockContext.issue.number = undefined
136148

137149
const checkName = ['Test Check']
138-
const table = [['Test', 'Result'], ['Example Test', 'Passed']]
150+
const table = [
151+
['Test', 'Result'],
152+
['Example Test', 'Passed']
153+
]
139154
const prId = 'invalid-number'
140155

141156
await attachComment(mockOctokit, checkName, false, table, [], [], [], prId)
@@ -154,7 +169,10 @@ describe('attachComment', () => {
154169
mockOctokit.paginate.mockResolvedValue([])
155170

156171
const checkName = ['Test Check']
157-
const table = [['Test', 'Result'], ['Example Test', 'Passed']]
172+
const table = [
173+
['Test', 'Result'],
174+
['Example Test', 'Passed']
175+
]
158176
const prId = ' 123 '
159177

160178
await attachComment(mockOctokit, checkName, false, table, [], [], [], prId)
@@ -181,20 +199,20 @@ describe('attachComment', () => {
181199
mockOctokit.paginate.mockResolvedValue([existingComment])
182200

183201
const checkName = ['Test Check']
184-
const table = [['Test', 'Result'], ['Example Test', 'Updated']]
202+
const table = [
203+
['Test', 'Result'],
204+
['Example Test', 'Updated']
205+
]
185206
const prId = '789'
186207

187208
await attachComment(mockOctokit, checkName, true, table, [], [], [], prId)
188209

189210
// Verify paginate was called with correct issue number
190-
expect(mockOctokit.paginate).toHaveBeenCalledWith(
191-
mockOctokit.rest.issues.listComments,
192-
{
193-
owner: 'test-owner',
194-
repo: 'test-repo',
195-
issue_number: 789
196-
}
197-
)
211+
expect(mockOctokit.paginate).toHaveBeenCalledWith(mockOctokit.rest.issues.listComments, {
212+
owner: 'test-owner',
213+
repo: 'test-repo',
214+
issue_number: 789
215+
})
198216

199217
// Verify comment was updated
200218
expect(mockOctokit.rest.issues.updateComment).toHaveBeenCalledWith({
@@ -205,7 +223,6 @@ describe('attachComment', () => {
205223
})
206224
expect(mockOctokit.rest.issues.createComment).not.toHaveBeenCalled()
207225
})
208-
209226
})
210227

211228
describe('buildCommentIdentifier', () => {
@@ -214,4 +231,4 @@ describe('buildCommentIdentifier', () => {
214231
const identifier = buildCommentIdentifier(checkName)
215232
expect(identifier).toBe('<!-- Summary comment for ["Test Check"] by mikepenz/action-junit-report -->')
216233
})
217-
})
234+
})

0 commit comments

Comments
 (0)