fix(gitea TLS): 固定略過憑證驗證並改用 Gitea context
This commit is contained in:
+2
-2
@@ -37,14 +37,14 @@ describe('gitea', () => {
|
||||
assert.ok(capturedOpts.headers['Authorization'].startsWith('token '));
|
||||
});
|
||||
|
||||
it('does not set httpsAgent by default (GITEA_SKIP_TLS_VERIFY not true)', async () => {
|
||||
it('sets an insecure httpsAgent by default', async () => {
|
||||
let capturedOpts;
|
||||
mock.method(axios, 'get', async (_url, opts) => {
|
||||
capturedOpts = opts;
|
||||
return { data: '' };
|
||||
});
|
||||
await getPRDiff();
|
||||
assert.equal(capturedOpts.httpsAgent, undefined);
|
||||
assert.equal(capturedOpts.httpsAgent.options.rejectUnauthorized, false);
|
||||
});
|
||||
|
||||
it('getPRDiff propagates axios errors', async () => {
|
||||
|
||||
Reference in New Issue
Block a user