@@ -43,7 +43,7 @@ describe('Jenkins', () => {
43
43
} ) ;
44
44
} ) ;
45
45
46
- it ( 'should fail if starting node-pull-request throws' , async ( ) => {
46
+ it ( 'should fail if starting node-pull-request throws' , async ( t ) => {
47
47
const cli = new TestCLI ( ) ;
48
48
const request = {
49
49
fetch : sinon . stub ( ) . returns ( Promise . resolve ( { status : 400 } ) ) ,
@@ -53,20 +53,20 @@ describe('Jenkins', () => {
53
53
} ;
54
54
55
55
const jobRunner = new RunPRJob ( cli , request , owner , repo , prid , true ) ;
56
- assert . strictEqual ( await jobRunner . start ( ) , false ) ;
56
+ t . assert . strictEqual ( await jobRunner . start ( ) , false ) ;
57
57
} ) ;
58
58
59
- it ( 'should return false if crumb fails' , async ( ) => {
59
+ it ( 'should return false if crumb fails' , async ( t ) => {
60
60
const cli = new TestCLI ( ) ;
61
61
const request = {
62
62
json : sinon . stub ( ) . throws ( )
63
63
} ;
64
64
65
65
const jobRunner = new RunPRJob ( cli , request , owner , repo , prid , true ) ;
66
- assert . strictEqual ( await jobRunner . start ( ) , false ) ;
66
+ t . assert . strictEqual ( await jobRunner . start ( ) , false ) ;
67
67
} ) ;
68
68
69
- it ( 'should start node-pull-request' , async ( ) => {
69
+ it ( 'should start node-pull-request' , async ( t ) => {
70
70
const cli = new TestCLI ( ) ;
71
71
72
72
const request = {
@@ -81,36 +81,36 @@ describe('Jenkins', () => {
81
81
} ) ,
82
82
fetch : sinon . stub ( )
83
83
. callsFake ( ( url , { method, headers, body } ) => {
84
- assert . strictEqual ( url , CI_PR_URL ) ;
85
- assert . strictEqual ( method , 'POST' ) ;
86
- assert . deepStrictEqual ( headers , { 'Jenkins-Crumb' : crumb } ) ;
87
- assert . ok ( body . _validated ) ;
84
+ t . assert . strictEqual ( url , CI_PR_URL ) ;
85
+ t . assert . strictEqual ( method , 'POST' ) ;
86
+ t . assert . deepStrictEqual ( headers , { 'Jenkins-Crumb' : crumb } ) ;
87
+ t . assert . ok ( body . _validated ) ;
88
88
return Promise . resolve ( { status : 201 } ) ;
89
89
} ) ,
90
90
json : sinon . stub ( ) . withArgs ( CI_CRUMB_URL )
91
91
. returns ( Promise . resolve ( { crumb } ) )
92
92
} ;
93
93
const jobRunner = new RunPRJob ( cli , request , owner , repo , prid , true ) ;
94
- assert . ok ( await jobRunner . start ( ) ) ;
94
+ t . assert . ok ( await jobRunner . start ( ) ) ;
95
95
} ) ;
96
96
97
- it ( 'should return false if node-pull-request not started' , async ( ) => {
97
+ it ( 'should return false if node-pull-request not started' , async ( t ) => {
98
98
const cli = new TestCLI ( ) ;
99
99
100
100
const request = {
101
101
fetch : sinon . stub ( )
102
102
. callsFake ( ( url , { method, headers, body } ) => {
103
- assert . strictEqual ( url , CI_PR_URL ) ;
104
- assert . strictEqual ( method , 'POST' ) ;
105
- assert . deepStrictEqual ( headers , { 'Jenkins-Crumb' : crumb } ) ;
106
- assert . ok ( body . _validated ) ;
103
+ t . assert . strictEqual ( url , CI_PR_URL ) ;
104
+ t . assert . strictEqual ( method , 'POST' ) ;
105
+ t . assert . deepStrictEqual ( headers , { 'Jenkins-Crumb' : crumb } ) ;
106
+ t . assert . ok ( body . _validated ) ;
107
107
return Promise . resolve ( { status : 401 } ) ;
108
108
} ) ,
109
109
json : sinon . stub ( ) . withArgs ( CI_CRUMB_URL )
110
110
. returns ( Promise . resolve ( { crumb } ) )
111
111
} ;
112
112
const jobRunner = new RunPRJob ( cli , request , owner , repo , prid , true ) ;
113
- assert . strictEqual ( await jobRunner . start ( ) , false ) ;
113
+ t . assert . strictEqual ( await jobRunner . start ( ) , false ) ;
114
114
} ) ;
115
115
116
116
describe ( 'without --certify-safe flag' , { concurrency : false } , ( ) => {
@@ -120,7 +120,7 @@ describe('Jenkins', () => {
120
120
for ( const certifySafe of [ true , false ] ) {
121
121
it ( `should return ${ certifySafe } if PR checker reports it as ${
122
122
certifySafe ? '' : 'potentially un'
123
- } safe`, async ( ) => {
123
+ } safe`, async ( t ) => {
124
124
const cli = new TestCLI ( ) ;
125
125
126
126
sinon . replace ( PRChecker . prototype , 'checkCommitsAfterReview' ,
@@ -138,18 +138,18 @@ describe('Jenkins', () => {
138
138
} ) ,
139
139
fetch : sinon . stub ( )
140
140
. callsFake ( ( url , { method, headers, body } ) => {
141
- assert . strictEqual ( url , CI_PR_URL ) ;
142
- assert . strictEqual ( method , 'POST' ) ;
143
- assert . deepStrictEqual ( headers , { 'Jenkins-Crumb' : crumb } ) ;
144
- assert . ok ( body . _validated ) ;
141
+ t . assert . strictEqual ( url , CI_PR_URL ) ;
142
+ t . assert . strictEqual ( method , 'POST' ) ;
143
+ t . assert . deepStrictEqual ( headers , { 'Jenkins-Crumb' : crumb } ) ;
144
+ t . assert . ok ( body . _validated ) ;
145
145
return Promise . resolve ( { status : 201 } ) ;
146
146
} ) ,
147
147
json : sinon . stub ( ) . withArgs ( CI_CRUMB_URL )
148
148
. returns ( Promise . resolve ( { crumb } ) )
149
149
} ;
150
150
151
151
const jobRunner = new RunPRJob ( cli , request , owner , repo , prid , false ) ;
152
- assert . strictEqual ( await jobRunner . start ( ) , certifySafe ) ;
152
+ t . assert . strictEqual ( await jobRunner . start ( ) , certifySafe ) ;
153
153
} ) ;
154
154
}
155
155
} ) ;
0 commit comments