mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
Merge branch 'main' into tyriar/274723_platform_terminal__api
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as fs from 'fs';
|
||||
import { join } from 'path';
|
||||
import 'mocha';
|
||||
import { ChatContext, ChatRequest, ChatRequestTurn, ChatRequestTurn2, ChatResult, Disposable, Event, EventEmitter, chat, commands, lm } from 'vscode';
|
||||
import { ChatContext, ChatRequest, ChatRequestTurn, ChatRequestTurn2, ChatResult, Disposable, env, Event, EventEmitter, chat, commands, lm, UIKind } from 'vscode';
|
||||
import { DeferredPromise, asPromise, assertNoRpc, closeAllEditors, delay, disposeAll } from '../utils';
|
||||
|
||||
suite('chat', () => {
|
||||
@@ -214,4 +216,28 @@ suite('chat', () => {
|
||||
// Title provider was not called again
|
||||
assert.strictEqual(calls, 1);
|
||||
});
|
||||
|
||||
test('can access node-pty module', async function () {
|
||||
// Required for copilot cli in chat extension.
|
||||
if (env.uiKind === UIKind.Web) {
|
||||
this.skip();
|
||||
}
|
||||
const nodePtyModules = [
|
||||
join(env.appRoot, 'node_modules.asar', 'node-pty'),
|
||||
join(env.appRoot, 'node_modules', 'node-pty')
|
||||
];
|
||||
|
||||
for (const modulePath of nodePtyModules) {
|
||||
// try to stat and require module
|
||||
try {
|
||||
await fs.promises.stat(modulePath);
|
||||
const nodePty = require(modulePath);
|
||||
assert.ok(nodePty, `Successfully required node-pty from ${modulePath}`);
|
||||
return;
|
||||
} catch (err) {
|
||||
// failed to require, try next
|
||||
}
|
||||
}
|
||||
assert.fail('Failed to find and require node-pty module');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user