Skip to content

Commit 2cfce4c

Browse files
authored
fix(node-runtime-worker-thread): Expose getShellPrompt method on the childProcessRuntime (#598)
1 parent 2004622 commit 2cfce4c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

packages/node-runtime-worker-thread/src/index.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ describe('WorkerRuntime', () => {
7171
});
7272
});
7373

74+
describe('getShellPrompt', () => {
75+
const testServer = startTestServer('shared');
76+
77+
it('should return prompt when connected to the server', async() => {
78+
const runtime = new WorkerRuntime(await testServer.connectionString());
79+
const result = await runtime.getShellPrompt();
80+
81+
expect(result).to.match(/>/);
82+
83+
await runtime.terminate();
84+
});
85+
});
86+
7487
describe('setEvaluationListener', () => {
7588
it('allows to set evaluation listener for runtime', async() => {
7689
const evalListener = {

packages/node-runtime-worker-thread/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ class WorkerRuntime implements Runtime {
6161
});
6262

6363
this.childProcessRuntime = createCaller(
64-
['init', 'evaluate', 'getCompletions', 'setEvaluationListener'],
64+
[
65+
'init',
66+
'evaluate',
67+
'getCompletions',
68+
'setEvaluationListener',
69+
'getShellPrompt'
70+
],
6571
this.childProcess
6672
);
6773

0 commit comments

Comments
 (0)