mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
@@ -5,8 +5,11 @@
|
|||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
var testExtensionContext: vscode.ExtensionContext;
|
||||||
|
}
|
||||||
|
|
||||||
export function activate(_context: vscode.ExtensionContext) {
|
export function activate(_context: vscode.ExtensionContext) {
|
||||||
// Set context as a global as some tests depend on it
|
// Set context as a global as some tests depend on it
|
||||||
// eslint-disable-next-line local/code-no-any-casts
|
global.testExtensionContext = _context;
|
||||||
(global as any).testExtensionContext = _context;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,8 +178,12 @@ suite('chat', () => {
|
|||||||
|
|
||||||
await commands.executeCommand('workbench.action.chat.newChat');
|
await commands.executeCommand('workbench.action.chat.newChat');
|
||||||
const result = await commands.executeCommand('workbench.action.chat.open', { query: 'hello', blockOnResponse: true });
|
const result = await commands.executeCommand('workbench.action.chat.open', { query: 'hello', blockOnResponse: true });
|
||||||
// eslint-disable-next-line local/code-no-any-casts
|
type PartialChatAgentResult = {
|
||||||
assert.strictEqual((result as any).errorDetails.code, 'rate_limited');
|
errorDetails: {
|
||||||
|
code: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
assert.strictEqual((<PartialChatAgentResult>result).errorDetails.code, 'rate_limited');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('title provider is called for first request', async () => {
|
test('title provider is called for first request', async () => {
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ import * as vscode from 'vscode';
|
|||||||
import { Straightforward, Middleware, RequestContext, ConnectContext, isRequest, isConnect } from 'straightforward';
|
import { Straightforward, Middleware, RequestContext, ConnectContext, isRequest, isConnect } from 'straightforward';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
|
|
||||||
|
declare module 'https' {
|
||||||
|
interface Agent {
|
||||||
|
testCertificates?: string[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
(vscode.env.uiKind === vscode.UIKind.Web ? suite.skip : suite)('vscode API - network proxy support', () => {
|
(vscode.env.uiKind === vscode.UIKind.Web ? suite.skip : suite)('vscode API - network proxy support', () => {
|
||||||
|
|
||||||
teardown(async function () {
|
teardown(async function () {
|
||||||
@@ -56,8 +62,7 @@ import assert from 'assert';
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Using https.globalAgent because it is shared with proxyResolver.ts and mutable.
|
// Using https.globalAgent because it is shared with proxyResolver.ts and mutable.
|
||||||
// eslint-disable-next-line local/code-no-any-casts
|
https.globalAgent.testCertificates = [certPEM];
|
||||||
(https.globalAgent as any).testCertificates = [certPEM];
|
|
||||||
resetCaches();
|
resetCaches();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -73,8 +78,7 @@ import assert from 'assert';
|
|||||||
.on('error', reject);
|
.on('error', reject);
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
// eslint-disable-next-line local/code-no-any-casts
|
delete https.globalAgent.testCertificates;
|
||||||
delete (https.globalAgent as any).testCertificates;
|
|
||||||
resetCaches();
|
resetCaches();
|
||||||
server.close();
|
server.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ suite('vscode API - globalState / workspaceState', () => {
|
|||||||
suiteSetup(async () => {
|
suiteSetup(async () => {
|
||||||
// Trigger extension activation and grab the context as some tests depend on it
|
// Trigger extension activation and grab the context as some tests depend on it
|
||||||
await extensions.getExtension('vscode.vscode-api-tests')?.activate();
|
await extensions.getExtension('vscode.vscode-api-tests')?.activate();
|
||||||
// eslint-disable-next-line local/code-no-any-casts
|
extensionContext = global.testExtensionContext;
|
||||||
extensionContext = (global as any).testExtensionContext;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('state basics', async () => {
|
test('state basics', async () => {
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import { assertNoRpc, poll } from '../utils';
|
|||||||
suiteSetup(async () => {
|
suiteSetup(async () => {
|
||||||
// Trigger extension activation and grab the context as some tests depend on it
|
// Trigger extension activation and grab the context as some tests depend on it
|
||||||
await extensions.getExtension('vscode.vscode-api-tests')?.activate();
|
await extensions.getExtension('vscode.vscode-api-tests')?.activate();
|
||||||
// eslint-disable-next-line local/code-no-any-casts
|
extensionContext = global.testExtensionContext;
|
||||||
extensionContext = (global as any).testExtensionContext;
|
|
||||||
|
|
||||||
const config = workspace.getConfiguration('terminal.integrated');
|
const config = workspace.getConfiguration('terminal.integrated');
|
||||||
// Disable conpty in integration tests because of https://github.com/microsoft/vscode/issues/76548
|
// Disable conpty in integration tests because of https://github.com/microsoft/vscode/issues/76548
|
||||||
|
|||||||
Reference in New Issue
Block a user