aboutsummaryrefslogtreecommitdiff
path: root/test/background/operators/impls/NavigateHistoryNextOperator.test.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-09-30 00:16:32 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-09-30 00:24:35 +0900
commitacfe1b78009b0c3183cd69eebdabb458e2079b73 (patch)
tree20b6c71228976173f4086d34aec552feadb461fc /test/background/operators/impls/NavigateHistoryNextOperator.test.ts
parentc843809ba29bd70c28b9a19e4cb3f1002edee781 (diff)
Move mock library to jest
Diffstat (limited to 'test/background/operators/impls/NavigateHistoryNextOperator.test.ts')
-rw-r--r--test/background/operators/impls/NavigateHistoryNextOperator.test.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/background/operators/impls/NavigateHistoryNextOperator.test.ts b/test/background/operators/impls/NavigateHistoryNextOperator.test.ts
index de8f597..8ea925b 100644
--- a/test/background/operators/impls/NavigateHistoryNextOperator.test.ts
+++ b/test/background/operators/impls/NavigateHistoryNextOperator.test.ts
@@ -1,4 +1,3 @@
-import sinon from "sinon";
import NavigateHistoryNextOperator from "../../../../src/background/operators/impls/NavigateHistoryNextOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
import MockNavigateClient from "../../mock/MockNavigateClient";
@@ -7,10 +6,9 @@ describe("NavigateHistoryNextOperator", () => {
describe("#run", () => {
it("send a message to navigate next in the history", async () => {
const navigateClient = new MockNavigateClient();
- const mock = sinon
- .mock(navigateClient)
- .expects("historyNext")
- .withArgs(1);
+ const historyNextSpy = jest
+ .spyOn(navigateClient, "historyNext")
+ .mockReturnValue(Promise.resolve());
const tabPresenter = new MockTabPresenter();
await tabPresenter.create("https://example.com/1", { active: false });
await tabPresenter.create("https://example.com/2", { active: true });
@@ -19,7 +17,7 @@ describe("NavigateHistoryNextOperator", () => {
await sut.run();
- mock.verify();
+ expect(historyNextSpy).toBeCalledWith(1);
});
});
});