@@ -9,7 +9,8 @@ import { addAssignees } from '../../src/utils/github';
9
9
describe ( 'addAssignees' , ( ) => {
10
10
disableNetConnect ( nock ) ;
11
11
12
- const logger = new Logger ( ) ;
12
+ const logger = new Logger ( ) ;
13
+ const octokit = new GitHub ( 'test-token' ) ;
13
14
14
15
it ( 'should do nothing 1' , async ( ) => {
15
16
const fn = jest . fn ( ) ;
@@ -20,7 +21,7 @@ describe('addAssignees', () => {
20
21
return body ;
21
22
} ) ;
22
23
23
- await addAssignees ( false , new GitHub ( '' ) , logger , getContext ( {
24
+ await addAssignees ( false , octokit , logger , getContext ( {
24
25
repo : {
25
26
owner : 'hello' ,
26
27
repo : 'world' ,
@@ -39,7 +40,7 @@ describe('addAssignees', () => {
39
40
return body ;
40
41
} ) ;
41
42
42
- await addAssignees ( [ ] , new GitHub ( '' ) , logger , getContext ( {
43
+ await addAssignees ( [ ] , octokit , logger , getContext ( {
43
44
repo : {
44
45
owner : 'hello' ,
45
46
repo : 'world' ,
@@ -50,8 +51,8 @@ describe('addAssignees', () => {
50
51
} ) ;
51
52
52
53
it ( 'should do nothing 3' , async ( ) => {
53
- const fn1 = jest . fn ( ) ;
54
- const fn2 = jest . fn ( ) ;
54
+ const fn1 = jest . fn ( ) ;
55
+ const fn2 = jest . fn ( ) ;
55
56
const mockStdout = spyOnStdout ( ) ;
56
57
nock ( 'https://api.github.com' )
57
58
. post ( '/repos/hello/world/issues/1/assignees' , body => {
@@ -67,7 +68,7 @@ describe('addAssignees', () => {
67
68
68
69
await addAssignees ( [
69
70
'test' ,
70
- ] , new GitHub ( '' ) , logger , getContext ( {
71
+ ] , octokit , logger , getContext ( {
71
72
repo : {
72
73
owner : 'hello' ,
73
74
repo : 'world' ,
@@ -84,7 +85,7 @@ describe('addAssignees', () => {
84
85
} ) ;
85
86
86
87
it ( 'should do nothing 4' , async ( ) => {
87
- const fn = jest . fn ( ) ;
88
+ const fn = jest . fn ( ) ;
88
89
const mockStdout = spyOnStdout ( ) ;
89
90
nock ( 'https://api.github.com' )
90
91
. post ( '/repos/hello/world/issues/1/assignees' , body => {
@@ -99,7 +100,7 @@ describe('addAssignees', () => {
99
100
100
101
await expect ( addAssignees ( [
101
102
'test' ,
102
- ] , new GitHub ( '' ) , logger , getContext ( {
103
+ ] , octokit , logger , getContext ( {
103
104
repo : {
104
105
owner : 'hello' ,
105
106
repo : 'world' ,
@@ -130,7 +131,7 @@ describe('addAssignees', () => {
130
131
131
132
await addAssignees ( [
132
133
'test' ,
133
- ] , new GitHub ( '' ) , logger , getContext ( {
134
+ ] , octokit , logger , getContext ( {
134
135
repo : {
135
136
owner : 'hello' ,
136
137
repo : 'world' ,
0 commit comments