From e304581fb15eabb3a973d363a282ee7546561e01 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 26 Sep 2021 17:01:31 +0900 Subject: Do not use chai on unit test --- .../background/completion/OpenCompletionUseCase.test.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'test/background/completion/OpenCompletionUseCase.test.ts') diff --git a/test/background/completion/OpenCompletionUseCase.test.ts b/test/background/completion/OpenCompletionUseCase.test.ts index f43e6c1..2284470 100644 --- a/test/background/completion/OpenCompletionUseCase.test.ts +++ b/test/background/completion/OpenCompletionUseCase.test.ts @@ -11,7 +11,6 @@ import CachedSettingRepository from "../../../src/background/repositories/Cached import Settings, { DefaultSetting, } from "../../../src/shared/settings/Settings"; -import { expect } from "chai"; import sinon from "sinon"; import Properties from "../../../src/shared/settings/Properties"; import Search from "../../../src/shared/settings/Search"; @@ -73,7 +72,7 @@ describe("OpenCompletionUseCase", () => { ); const items = await sut.getCompletionTypes(); - expect(items).to.deep.equal([ + expect(items).toEqual([ CompletionType.SearchEngines, CompletionType.History, CompletionType.Bookmarks, @@ -99,17 +98,17 @@ describe("OpenCompletionUseCase", () => { ) ); - expect(await sut.requestSearchEngines("")).to.deep.equal([ + expect(await sut.requestSearchEngines("")).toEqual([ "google", "yahoo", "bing", "googleja", ]); - expect(await sut.requestSearchEngines("go")).to.deep.equal([ + expect(await sut.requestSearchEngines("go")).toEqual([ "google", "googleja", ]); - expect(await sut.requestSearchEngines("x")).to.be.empty; + expect(await sut.requestSearchEngines("x")).toHaveLength(0); }); }); @@ -127,11 +126,11 @@ describe("OpenCompletionUseCase", () => { .withArgs("xyz") .returns(Promise.resolve([])); - expect(await sut.requestBookmarks("site")).to.deep.equal([ + expect(await sut.requestBookmarks("site")).toEqual([ { title: "site1", url: "https://site1.example.com" }, { title: "site2", url: "https://site2.example.com/" }, ]); - expect(await sut.requestBookmarks("xyz")).to.be.empty; + expect(await sut.requestBookmarks("xyz")).toHaveLength(0); }); }); @@ -149,11 +148,11 @@ describe("OpenCompletionUseCase", () => { .withArgs("xyz") .returns(Promise.resolve([])); - expect(await sut.requestHistory("site")).to.deep.equal([ + expect(await sut.requestHistory("site")).toEqual([ { title: "site1", url: "https://site1.example.com" }, { title: "site2", url: "https://site2.example.com/" }, ]); - expect(await sut.requestHistory("xyz")).to.be.empty; + expect(await sut.requestHistory("xyz")).toHaveLength(0); }); }); }); -- cgit v1.2.3