File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ const getPullsListByBranch = require('../get-pulls-list')
8
8
9
9
describe ( 'getPullsListByBranch' , ( ) => {
10
10
let params = { }
11
+ let pullRequestValues = {
12
+ title : 'Pull request title' ,
13
+ body : 'Pull request body'
14
+ }
11
15
12
16
beforeAll ( ( ) => {
13
17
jest . spyOn ( core , 'info' ) . mockImplementation ( jest . fn ( ) )
@@ -16,26 +20,23 @@ describe('getPullsListByBranch', () => {
16
20
params = {
17
21
head : 'main' ,
18
22
base : 'develop' ,
19
- body : 'some-body' ,
20
23
repo : 'some-repo' ,
21
24
owner : 'some-owner' ,
22
- title : 'some-title' ,
25
+ body : 'Pull request body' ,
26
+ title : 'Pull request title' ,
23
27
}
24
28
} )
25
29
26
30
afterAll ( ( ) => {
27
31
jest . restoreAllMocks ( )
28
32
} )
29
33
30
- test ( 'Get already opened pull request' , async ( ) => {
31
- const data = await getPullsListByBranch ( octokit , params )
32
- const expectedValue = {
33
- state : "open" ,
34
- title : "Amazing new feature" ,
35
- url : "https://api.github.com/repos/octocat/Hello-World/pulls/134" ,
36
- number : 134 ,
37
- }
34
+ test ( 'When there is no open sync pull request' , async ( ) => {
35
+ const data = await getPullsListByBranch ( octokit , {
36
+ pullRequestValues,
37
+ params
38
+ } )
38
39
39
- expect ( data ) . toEqual ( expectedValue )
40
+ expect ( data ) . toEqual ( false )
40
41
} )
41
42
} )
You can’t perform that action at this time.
0 commit comments