From acfe1b78009b0c3183cd69eebdabb458e2079b73 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Thu, 30 Sep 2021 00:16:32 +0900 Subject: Move mock library to jest --- .../operators/impls/NavigateHistoryNextOperator.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'test/background/operators/impls/NavigateHistoryNextOperator.test.ts') 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); }); }); }); -- cgit v1.2.3