Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/node-runtime-worker-thread/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ describe('WorkerRuntime', () => {
});
});

describe('getShellPrompt', () => {
const testServer = startTestServer('shared');

it('should return prompt when connected to the server', async() => {
const runtime = new WorkerRuntime(await testServer.connectionString());
const result = await runtime.getShellPrompt();

expect(result).to.match(/>/);

await runtime.terminate();
});
});

describe('setEvaluationListener', () => {
it('allows to set evaluation listener for runtime', async() => {
const evalListener = {
Expand Down
8 changes: 7 additions & 1 deletion packages/node-runtime-worker-thread/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ class WorkerRuntime implements Runtime {
});

this.childProcessRuntime = createCaller(
['init', 'evaluate', 'getCompletions', 'setEvaluationListener'],
[
'init',
'evaluate',
'getCompletions',
'setEvaluationListener',
'getShellPrompt'
],
this.childProcess
);

Expand Down