@@ -42,31 +42,28 @@ describe('inputs', () => {
4242 delete process . env . CLOSED_ALERTS_FILEPATH
4343 } )
4444
45- it ( 'should throw an error if frequency is not a number ' , async ( ) => {
45+ it ( 'should default frequency to 0 when no action input is provided ' , async ( ) => {
4646 process . env . FREQUENCY = 'invalid-frequency'
4747
48- await expect ( inputs ( ) ) . rejects . toThrowError (
49- "context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"
50- )
48+ const result = await inputs ( )
49+ expect ( result ) . toHaveProperty ( 'frequency' , 0 )
5150
5251 delete process . env . FREQUENCY
5352 } )
5453
55- it ( " should throw an error if scope is not 'repo' or 'org'" , async ( ) => {
54+ it ( ' should default scope to an empty string when no action input is provided' , async ( ) => {
5655 process . env . SCOPE = 'invalid-scope'
5756
58- await expect ( inputs ( ) ) . rejects . toThrowError (
59- "context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"
60- )
57+ const result = await inputs ( )
58+ expect ( result ) . toHaveProperty ( 'scope' , '' )
6159
6260 delete process . env . SCOPE
6361 } )
6462
65- it ( 'should throw an error if GITHUB_TOKEN is not set ' , async ( ) => {
63+ it ( 'should default token to an empty string when no action input is provided ' , async ( ) => {
6664 delete process . env . GITHUB_TOKEN
6765
68- await expect ( inputs ( ) ) . rejects . toThrowError (
69- "context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'"
70- )
66+ const result = await inputs ( )
67+ expect ( result ) . toHaveProperty ( 'api_token' , '' )
7168 } )
7269} )
0 commit comments