Update to @vscode/proxy-agent 0.21.0

This commit is contained in:
Christof Marti
2024-06-24 14:11:39 +02:00
parent 1b883b238e
commit 3cdb165262
6 changed files with 19 additions and 19 deletions

View File

@@ -8,7 +8,7 @@ import 'mocha';
import { assertNoRpc } from '../utils';
import { pki } from 'node-forge';
import { AddressInfo } from 'net';
import { resetCaches } from '@vscode/proxy-agent';
import { resetCaches, testCertificates } from '@vscode/proxy-agent';
suite('vscode API - network proxy support', () => {
@@ -52,8 +52,8 @@ suite('vscode API - network proxy support', () => {
rejectPort(err);
});
// Using https.globalAgent because it is shared with proxyResolver.ts and mutable.
(https.globalAgent as any).testCertificates = [certPEM];
// Using `testCertificates` shared between proxyResolver.ts and proxy.test.ts.
testCertificates.splice(0, testCertificates.length, certPEM);
resetCaches();
try {
@@ -69,7 +69,7 @@ suite('vscode API - network proxy support', () => {
.on('error', reject);
});
} finally {
delete (https.globalAgent as any).testCertificates;
testCertificates.splice(0, testCertificates.length);
resetCaches();
server.close();
}