You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('should fail if there is no provided GitHub Token, Access Token or SSH bool',async()=>{
88
-
Object.assign(action,{
89
-
silent: false,
90
-
repositoryPath: null,
91
-
folder: 'assets',
92
-
branch: 'branch',
93
-
pusher: {
94
-
name: 'asd',
95
-
email: 'as@cat'
96
-
}
97
-
})
98
-
99
-
try{
100
-
awaitinit(action)
101
-
}catch(e){
102
-
expect(execute).toBeCalledTimes(0)
103
-
expect(e.message).toMatch(
104
-
'There was an error initializing the repository: No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true. ❌'
105
-
)
106
-
}
107
-
})
108
-
109
-
it('should fail if access token is defined but it is an empty string',async()=>{
110
-
Object.assign(action,{
111
-
silent: false,
112
-
repositoryPath: null,
113
-
folder: 'assets',
114
-
branch: 'branch',
115
-
pusher: {
116
-
name: 'asd',
117
-
email: 'as@cat'
118
-
},
119
-
accessToken: ''
120
-
})
121
-
122
-
try{
123
-
awaitinit(action)
124
-
}catch(e){
125
-
expect(execute).toBeCalledTimes(0)
126
-
expect(e.message).toMatch(
127
-
'There was an error initializing the repository: No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true. ❌'
'There was an error initializing the repository: You must provide the action with a folder to deploy. ❌'
152
-
)
153
-
}
154
-
})
155
-
156
-
it('should fail if there is no provided repository path',async()=>{
157
-
Object.assign(action,{
158
-
silent: true,
159
-
repositoryPath: null,
160
-
folder: 'assets',
161
-
branch: 'branch',
162
-
pusher: {
163
-
name: 'asd',
164
-
email: 'as@cat'
165
-
},
166
-
gitHubToken: '123',
167
-
accessToken: null,
168
-
ssh: null
169
-
})
170
-
171
-
try{
172
-
awaitinit(action)
173
-
}catch(e){
174
-
expect(execute).toBeCalledTimes(0)
175
-
expect(e.message).toMatch(
176
-
'There was an error initializing the repository: No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true. '
it('should stash changes if preserve is true',async()=>{
201
36
Object.assign(action,{
202
37
silent: false,
@@ -213,7 +48,6 @@ describe('git', () => {
213
48
})
214
49
215
50
awaitinit(action)
216
-
217
51
expect(execute).toBeCalledTimes(7)
218
52
})
219
53
})
@@ -234,27 +68,6 @@ describe('git', () => {
234
68
awaitgenerateBranch(action)
235
69
expect(execute).toBeCalledTimes(6)
236
70
})
237
-
238
-
it('should fail if there is no branch',async()=>{
239
-
Object.assign(action,{
240
-
silent: false,
241
-
accessToken: '123',
242
-
branch: null,
243
-
folder: '.',
244
-
pusher: {
245
-
name: 'asd',
246
-
email: 'as@cat'
247
-
}
248
-
})
249
-
250
-
try{
251
-
awaitgenerateBranch(action)
252
-
}catch(e){
253
-
expect(e.message).toMatch(
254
-
'There was an error creating the deployment branch: Branch is required. ❌'
255
-
)
256
-
}
257
-
})
258
71
})
259
72
260
73
describe('switchToBaseBranch',()=>{
@@ -290,31 +103,6 @@ describe('git', () => {
290
103
awaitswitchToBaseBranch(action)
291
104
expect(execute).toBeCalledTimes(1)
292
105
})
293
-
294
-
it('should fail if one of the required parameters is not available',async()=>{
295
-
Object.assign(action,{
296
-
silent: false,
297
-
baseBranch: '123',
298
-
accessToken: null,
299
-
gitHubToken: null,
300
-
ssh: null,
301
-
branch: 'branch',
302
-
folder: null,
303
-
pusher: {
304
-
name: 'asd',
305
-
email: 'as@cat'
306
-
}
307
-
})
308
-
309
-
try{
310
-
awaitswitchToBaseBranch(action)
311
-
}catch(e){
312
-
expect(execute).toBeCalledTimes(0)
313
-
expect(e.message).toMatch(
314
-
'There was an error switching to the base branch: No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true. ❌'
315
-
)
316
-
}
317
-
})
318
106
})
319
107
320
108
describe('deploy',()=>{
@@ -488,31 +276,5 @@ describe('git', () => {
488
276
expect(rmRF).toBeCalledTimes(1)
489
277
expect(response).toBe(Status.SKIPPED)
490
278
})
491
-
492
-
it('should throw an error if one of the required parameters is not available',async()=>{
493
-
Object.assign(action,{
494
-
silent: false,
495
-
folder: 'assets',
496
-
branch: 'branch',
497
-
ssh: null,
498
-
accessToken: null,
499
-
gitHubToken: null,
500
-
pusher: {
501
-
name: 'asd',
502
-
email: 'as@cat'
503
-
},
504
-
isTest: false// Setting this env variable to false means there will never be anything to commit and the action will exit early.
505
-
})
506
-
507
-
try{
508
-
awaitdeploy(action)
509
-
}catch(e){
510
-
expect(execute).toBeCalledTimes(1)
511
-
expect(rmRF).toBeCalledTimes(1)
512
-
expect(e.message).toMatch(
513
-
'The deploy step encountered an error: No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true. ❌'
0 commit comments