Skip to content

Commit e178923

Browse files
committed
update unit tests
1 parent 149ec36 commit e178923

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

__tests__/functions/actions-status.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
import * as core from '@actions/core'
12
import {actionStatus} from '../../src/functions/action-status'
23
import {truncateCommentBody} from '../../src/functions/truncate-comment-body'
34

45
var context
56
var octokit
67
beforeEach(() => {
78
jest.clearAllMocks()
9+
10+
jest.spyOn(core, 'debug').mockImplementation(() => {})
11+
jest.spyOn(core, 'warning').mockImplementation(() => {})
12+
813
process.env.GITHUB_SERVER_URL = 'https://github.com'
914
process.env.GITHUB_RUN_ID = '12345'
1015

__tests__/functions/truncate-comment-body.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
import * as core from '@actions/core'
12
import {truncateCommentBody} from '../../src/functions/truncate-comment-body'
23

4+
beforeEach(() => {
5+
jest.clearAllMocks()
6+
jest.spyOn(core, 'debug').mockImplementation(() => {})
7+
jest.spyOn(core, 'warning').mockImplementation(() => {})
8+
})
9+
310
test('truncates a long message', () => {
411
const message = 'a'.repeat(65537)
512
const got = truncateCommentBody(message)

0 commit comments

Comments
 (0)