File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,46 @@ describe('With a new github client', () => {
171171 } )
172172} )
173173
174+ describe ( 'With a new github client without label' , ( ) => {
175+ let client : GitHubClient
176+
177+ beforeAll ( ( ) => {
178+ process . env [ 'GITHUB_PATH' ] = ''
179+
180+ Object . defineProperty ( github , 'context' , {
181+ value : {
182+ eventName : 'issues' ,
183+ repo : {
184+ owner : 'puppetlabs' ,
185+ repo : 'iac'
186+ } ,
187+ issue : {
188+ number : 331
189+ } ,
190+ payload : {
191+ action : 'opened' ,
192+ sender : {
193+ login : 'dependabot[bot]'
194+ } ,
195+ issue : {
196+ labels : [
197+ ]
198+ }
199+ }
200+ }
201+ } )
202+
203+ client = new GitHubClient ( '1234' )
204+ console . log ( '::stop-commands::stoptoken' )
205+ process . stdout . write = jest . fn ( )
206+ } )
207+
208+ test ( 'getLabels returns false if the label does not exist on the issue or pr' , ( ) => {
209+ const result = client . getLabels ( )
210+ expect ( result ) . toBe ( false )
211+ } )
212+ } )
213+
174214describe ( 'With an invalid event in the payload' , ( ) => {
175215 beforeAll ( ( ) => {
176216 Object . defineProperty ( github , 'context' , {
You can’t perform that action at this time.
0 commit comments