Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-Carneiro-KX committed Feb 8, 2024
1 parent aa71310 commit 1115b48
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/suite/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,30 @@ describe("serverCommand", () => {
sinon.assert.notCalled(writeResultsViewStub);
});
});

describe("getConextForRerunQuery", function () {
it("should return correct context for given input", function () {
assert.equal(serverCommand.getConextForRerunQuery("\\d .foo"), ".foo");
assert.equal(
serverCommand.getConextForRerunQuery('system "d .bar'),
".bar",
);
});

it("should return default context for input without context", function () {
assert.equal(
serverCommand.getConextForRerunQuery("no context here"),
".",
);
});

it("should return last context for input with multiple contexts", function () {
assert.equal(
serverCommand.getConextForRerunQuery("\\d .foo\n\\d .bar"),
".foo",
);
});
});
});

describe("walkthroughCommand", () => {
Expand Down

0 comments on commit 1115b48

Please sign in to comment.