@@ -67,8 +67,8 @@ describe('input-helper tests', () => {
67
67
jest . restoreAllMocks ( )
68
68
} )
69
69
70
- it ( 'sets defaults' , ( ) => {
71
- const settings : IGitSourceSettings = inputHelper . getInputs ( )
70
+ it ( 'sets defaults' , async ( ) => {
71
+ const settings : IGitSourceSettings = await inputHelper . getInputs ( )
72
72
expect ( settings ) . toBeTruthy ( )
73
73
expect ( settings . authToken ) . toBeFalsy ( )
74
74
expect ( settings . clean ) . toBe ( true )
@@ -82,11 +82,11 @@ describe('input-helper tests', () => {
82
82
expect ( settings . repositoryPath ) . toBe ( gitHubWorkspace )
83
83
} )
84
84
85
- it ( 'qualifies ref' , ( ) => {
85
+ it ( 'qualifies ref' , async ( ) => {
86
86
let originalRef = github . context . ref
87
87
try {
88
88
github . context . ref = 'some-unqualified-ref'
89
- const settings : IGitSourceSettings = inputHelper . getInputs ( )
89
+ const settings : IGitSourceSettings = await inputHelper . getInputs ( )
90
90
expect ( settings ) . toBeTruthy ( )
91
91
expect ( settings . commit ) . toBe ( '1234567890123456789012345678901234567890' )
92
92
expect ( settings . ref ) . toBe ( 'refs/heads/some-unqualified-ref' )
@@ -97,36 +97,37 @@ describe('input-helper tests', () => {
97
97
98
98
it ( 'requires qualified repo' , ( ) => {
99
99
inputs . repository = 'some-unqualified-repo'
100
- assert . throws ( ( ) => {
101
- inputHelper . getInputs ( )
102
- } , / I n v a l i d r e p o s i t o r y ' s o m e - u n q u a l i f i e d - r e p o ' / )
100
+ assert . rejects (
101
+ ( ) => inputHelper . getInputs ( ) ,
102
+ / I n v a l i d r e p o s i t o r y ' s o m e - u n q u a l i f i e d - r e p o ' /
103
+ )
103
104
} )
104
105
105
- it ( 'roots path' , ( ) => {
106
+ it ( 'roots path' , async ( ) => {
106
107
inputs . path = 'some-directory/some-subdirectory'
107
- const settings : IGitSourceSettings = inputHelper . getInputs ( )
108
+ const settings : IGitSourceSettings = await inputHelper . getInputs ( )
108
109
expect ( settings . repositoryPath ) . toBe (
109
110
path . join ( gitHubWorkspace , 'some-directory' , 'some-subdirectory' )
110
111
)
111
112
} )
112
113
113
- it ( 'sets correct default ref/sha for other repo' , ( ) => {
114
+ it ( 'sets correct default ref/sha for other repo' , async ( ) => {
114
115
inputs . repository = 'some-owner/some-other-repo'
115
- const settings : IGitSourceSettings = inputHelper . getInputs ( )
116
+ const settings : IGitSourceSettings = await inputHelper . getInputs ( )
116
117
expect ( settings . ref ) . toBe ( 'refs/heads/master' )
117
118
expect ( settings . commit ) . toBeFalsy ( )
118
119
} )
119
120
120
- it ( 'sets ref to empty when explicit sha' , ( ) => {
121
+ it ( 'sets ref to empty when explicit sha' , async ( ) => {
121
122
inputs . ref = '1111111111222222222233333333334444444444'
122
- const settings : IGitSourceSettings = inputHelper . getInputs ( )
123
+ const settings : IGitSourceSettings = await inputHelper . getInputs ( )
123
124
expect ( settings . ref ) . toBeFalsy ( )
124
125
expect ( settings . commit ) . toBe ( '1111111111222222222233333333334444444444' )
125
126
} )
126
127
127
- it ( 'sets sha to empty when explicit ref' , ( ) => {
128
+ it ( 'sets sha to empty when explicit ref' , async ( ) => {
128
129
inputs . ref = 'refs/heads/some-other-ref'
129
- const settings : IGitSourceSettings = inputHelper . getInputs ( )
130
+ const settings : IGitSourceSettings = await inputHelper . getInputs ( )
130
131
expect ( settings . ref ) . toBe ( 'refs/heads/some-other-ref' )
131
132
expect ( settings . commit ) . toBeFalsy ( )
132
133
} )
0 commit comments