@@ -44,6 +44,7 @@ describe('configFromJobInput()', function () {
4444 'alert-comment-cc-users' : '' ,
4545 'external-data-json-path' : '' ,
4646 'max-items-in-chart' : '' ,
47+ 'commit-sha' : '' ,
4748 } ;
4849
4950 const validation_tests = [
@@ -158,6 +159,11 @@ describe('configFromJobInput()', function () {
158159 inputs : { ...defaultInputs , 'alert-threshold' : '150%' , 'fail-threshold' : '120%' } ,
159160 expected : / ' a l e r t - t h r e s h o l d ' v a l u e m u s t b e s m a l l e r t h a n ' f a i l - t h r e s h o l d ' v a l u e b u t g o t 1 .5 > 1 .2 / ,
160161 } ,
162+ {
163+ what : 'commit-sha is set but github-token is not set' ,
164+ inputs : { ...defaultInputs , 'commit-sha' : 'dummy sha' , 'github-token' : '' } ,
165+ expected : / ' c o m m i t - s h a ' i s e n a b l e d b u t ' g i t h u b - t o k e n ' i s n o t s e t / ,
166+ } ,
161167 ] as Array < {
162168 what : string ;
163169 inputs : Inputs ;
@@ -185,6 +191,7 @@ describe('configFromJobInput()', function () {
185191 hasExternalDataJsonPath : boolean ;
186192 maxItemsInChart : null | number ;
187193 failThreshold : number | null ;
194+ commitSha : string | undefined ;
188195 }
189196
190197 const defaultExpected : ExpectedResult = {
@@ -201,6 +208,7 @@ describe('configFromJobInput()', function () {
201208 hasExternalDataJsonPath : false ,
202209 maxItemsInChart : null ,
203210 failThreshold : null ,
211+ commitSha : undefined ,
204212 } ;
205213
206214 const returnedConfigTests = [
@@ -350,7 +358,7 @@ describe('configFromJobInput()', function () {
350358 const absCwd = process . cwd ( ) ;
351359 if ( ! absCwd . startsWith ( home ) ) {
352360 // Test was not run under home directory so "~" in paths cannot be tested
353- fail ( 'Test was not run under home directory so "~" in paths cannot be tested' ) ;
361+ A . fail ( 'Test was not run under home directory so "~" in paths cannot be tested' ) ;
354362 }
355363
356364 const cwd = path . join ( '~' , absCwd . slice ( home . length ) ) ;
0 commit comments