Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit 71e5ad2

Browse files
committed
SIGN-8057 Fix build
1 parent 7d300c1 commit 71e5ad2

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

actions/submit-signing-request/tests/task.test.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ beforeEach(() => {
5959
status: 'Completed',
6060
unsignedArtifactLink: "unused",
6161
signedArtifactLink: "unused",
62-
logs: [ { message: testConnectorLogMessage, level: 'Information' } ]
62+
logs: [{ message: testConnectorLogMessage, level: 'Information' }]
6363
};
6464

65-
const getSigningRequestStatusResponse : SigningRequestStatusDto = {
65+
const getSigningRequestStatusResponse: SigningRequestStatusDto = {
6666
status: submitSigningRequestResponse.status,
6767
hasArtifactBeenDownloadedBySignPathInCaseOfArtifactRetrieval: true,
6868
isFinalStatus: true,
@@ -107,9 +107,9 @@ it('test that the task fails if the signing request submit fails', async () => {
107107

108108
it('test that the task fails if the signing request has "Failed" as a final status', async () => {
109109
const setFailedStub = sandbox.stub(core, 'setFailed')
110-
.withArgs(sinon.match((value:any) => {
110+
.withArgs(sinon.match((value: any) => {
111111
return value.includes('TEST_FAILED')
112-
&& value.includes('The signing request is not completed.');
112+
&& value.includes('The signing request is not completed.');
113113
}));
114114

115115
const failedStatusSigningRequestResponse = {
@@ -121,7 +121,7 @@ it('test that the task fails if the signing request has "Failed" as a final stat
121121

122122
await task.run();
123123
assert.equal(setFailedStub.calledOnce, true, 'setFailed should be called once');
124-
});
124+
});
125125

126126
it('test that the signing request was not submitted due to validation errors', async () => {
127127
const submitSigningRequestValidationErrorResponse = {
@@ -138,17 +138,17 @@ it('test that the signing request was not submitted due to validation errors', a
138138
sandbox.stub(axios, 'post').resolves({ data: submitSigningRequestValidationErrorResponse });
139139
// check that task was marked as failed, because of validation errors
140140
const setFailedStub = sandbox.stub(core, 'setFailed')
141-
.withArgs(sinon.match((value:any) => {
141+
.withArgs(sinon.match((value: any) => {
142142
return value.includes('CI system validation failed');
143143
}));
144144
// check that error message was logged
145145
const errorLogStub = sandbox.stub(core, 'error')
146-
.withArgs(sinon.match((value:any) => {
146+
.withArgs(sinon.match((value: any) => {
147147
return value.includes('TEST_ERROR');
148148
}));
149149
// check that howToFix message was logged
150150
const coreInfoStub = sandbox.stub(core, 'info')
151-
.withArgs(sinon.match((value:any) => {
151+
.withArgs(sinon.match((value: any) => {
152152
return value.includes('TEST_FIX');
153153
}));
154154

@@ -160,19 +160,19 @@ it('test that the signing request was not submitted due to validation errors', a
160160

161161
it('test that the output variables are set correctly', async () => {
162162
await task.run();
163-
assert.equal(setOutputStub.calledWith('signing-request-id', testSigningRequestId), true);
163+
assert.equal(setOutputStub.calledWith('signing-request-id', testSigningRequestId), true);
164164
assert.equal(setOutputStub.calledWith('signing-request-web-url', testSigningRequestUrl), true);
165-
165+
166166
// TODO: drop?
167167
// assert.equal(setOutputStub.calledWith('signpath-api-url', testSignPathUrl + '/API'), true);
168168

169169
// TODO:
170-
//assert.equal(setOutputStub.calledWith('signed-artifact-download-url', testSignedArtifactLink), true);
170+
// assert.equal(setOutputStub.calledWith('signed-artifact-download-url', testSignedArtifactLink), true);
171171
});
172172

173173
it('connector logs logged to the build log', async () => {
174174
const coreInfoStub = sandbox.stub(core, 'info')
175-
.withArgs(sinon.match((value:any) => {
175+
.withArgs(sinon.match((value: any) => {
176176
return value.includes(testConnectorLogMessage);
177177
}));
178178
await task.run();
@@ -182,7 +182,7 @@ it('connector logs logged to the build log', async () => {
182182
it('test that the connectors url has api version', async () => {
183183
await task.run();
184184
assert.equal(axiosPostStub.calledWith(
185-
sinon.match((value:any) => {
185+
sinon.match((value: any) => {
186186
return value.indexOf('api-version') !== -1;
187187
})), true);
188188
});
@@ -191,7 +191,7 @@ it('test if input variables are passed through', async () => {
191191
await task.run();
192192
assert.equal(axiosPostStub.calledWith(
193193
sinon.match.any,
194-
sinon.match((value:any) => {
194+
sinon.match((value: any) => {
195195
return value.artifactId === testGitHubArtifactId
196196
&& value.signPathProjectSlug === testProjectSlug
197197
&& value.signPathSigningPolicySlug === testSigningPolicySlug
@@ -210,7 +210,7 @@ it('task fails if the submit request connector fails', async () => {
210210
throw { response: { data: httpCallError } };
211211
});
212212
const setFailedStub = sandbox.stub(core, 'setFailed')
213-
.withArgs(sinon.match((value:string) => {
213+
.withArgs(sinon.match((value: string) => {
214214
return value.indexOf(httpCallError) !== -1;
215215
}));
216216
await task.run();
@@ -244,7 +244,7 @@ it('if submit signing request fails with 429,502,503,504 the task retries', asyn
244244
await task.run();
245245

246246
// signing request id should be set in the output
247-
assert.equal(setOutputStub.calledWith('signing-request-id', retryTestId), true);
247+
assert.equal(setOutputStub.calledWith('signing-request-id', retryTestId), true);
248248
});
249249

250250
it('no retries for http code 500', async () => {
@@ -265,15 +265,15 @@ it('task waits for unsigned artifact being downloaded by SignPath before complet
265265

266266
// non-default input map, with 'wait-for-completion' set to 'false'
267267
getInputStub.restore();
268-
const input = Object.assign({ }, defaultTestInputMap);
268+
const input = Object.assign({}, defaultTestInputMap);
269269
input['wait-for-completion'] = 'false';
270270
getInputStub = sandbox.stub(core, 'getInput').callsFake((paramName) => {
271271
return input[paramName as keyof typeof input] || 'test';
272272
});
273273

274274
const addGetRequestDataResponse = (hasArtifactBeenDownloadedBySignPathInCaseOfArtifactRetrieval: boolean) => {
275275
return nock(testConnectorUrl).get(uri => uri.includes('SigningRequests')).once().reply(200, {
276-
hasArtifactBeenDownloadedBySignPathInCaseOfArtifactRetrieval: hasArtifactBeenDownloadedBySignPathInCaseOfArtifactRetrieval
276+
hasArtifactBeenDownloadedBySignPathInCaseOfArtifactRetrieval
277277
});
278278
}
279279

@@ -308,7 +308,7 @@ it('if the signing request status is final, the task stops checking for artifact
308308

309309
// non-default input map, with 'wait-for-completion' set to 'false'
310310
getInputStub.restore();
311-
const input = Object.assign({ }, defaultTestInputMap);
311+
const input = Object.assign({}, defaultTestInputMap);
312312
input['wait-for-completion'] = 'false';
313313
getInputStub = sandbox.stub(core, 'getInput').callsFake((paramName) => {
314314
return input[paramName as keyof typeof input] || 'test';

0 commit comments

Comments
 (0)