Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #472 from KrzysztofSikoraCodete/evaluate-request-test
Browse files Browse the repository at this point in the history
Evaluate request
  • Loading branch information
jtpio committed Jun 16, 2020
2 parents 881ed8d + 4e6cac2 commit a056c28
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/session.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,26 @@ describe('protocol', () => {
expect(sourceCode).toEqual(code);
});
});

describe('#evaluate', () => {
it('should evaluate the code sent to the kernel', async () => {
const stackFramesReply = await debugSession.sendRequest('stackTrace', {
threadId
});
const frameId = stackFramesReply.body.stackFrames[0].id;
const reply = await debugSession.sendRequest('evaluate', {
frameId,
context: 'repl',
expression: 'k = 123',
format: {}
});
expect(reply.success).toBe(true);

const variables = await getVariables();
const k = find(variables, variable => variable.name === 'k');
expect(k).toBeDefined();
expect(k.type).toEqual('int');
expect(k.value).toEqual('123');
});
});
});

0 comments on commit a056c28

Please sign in to comment.