Skip to content

Commit bdce777

Browse files
add test
1 parent a548084 commit bdce777

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/suite/commands.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,31 @@ describe("serverCommand", () => {
14001400

14011401
executeCommandStub.restore();
14021402
});
1403+
1404+
it("should call executeCommand with correct arguments for an error", () => {
1405+
const result = "Error: test error";
1406+
const executeCommandStub = sinon.stub(vscode.commands, "executeCommand");
1407+
1408+
serverCommand.writeQueryResultsToView(
1409+
result,
1410+
"",
1411+
"testConn",
1412+
"testFile.kdb.q",
1413+
false,
1414+
"WORKBOOK",
1415+
false,
1416+
"2",
1417+
);
1418+
1419+
sinon.assert.calledWith(
1420+
executeCommandStub.firstCall,
1421+
"kdb.resultsPanel.update",
1422+
result,
1423+
false,
1424+
);
1425+
1426+
executeCommandStub.restore();
1427+
});
14031428
});
14041429
describe("enableTLS", () => {
14051430
let getServersStub: sinon.SinonStub;

0 commit comments

Comments
 (0)