aboutsummaryrefslogtreecommitdiff
path: root/test/shared/settings/Settings.test.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-09-26 17:01:31 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-09-26 17:23:14 +0900
commite304581fb15eabb3a973d363a282ee7546561e01 (patch)
tree1afb21a2dee2ada3d10c1417fa61c0aae1f83077 /test/shared/settings/Settings.test.ts
parent11d6d725eee2ac0a1c16e4c7a4ce4f296bb6b016 (diff)
Do not use chai on unit test
Diffstat (limited to 'test/shared/settings/Settings.test.ts')
-rw-r--r--test/shared/settings/Settings.test.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/test/shared/settings/Settings.test.ts b/test/shared/settings/Settings.test.ts
index 951c9cd..49a5d0b 100644
--- a/test/shared/settings/Settings.test.ts
+++ b/test/shared/settings/Settings.test.ts
@@ -1,5 +1,4 @@
import Settings from "../../../src/shared/settings/Settings";
-import { expect } from "chai";
describe("Settings", () => {
describe("#valueOf", () => {
@@ -21,7 +20,7 @@ describe("Settings", () => {
search: x.search.toJSON(),
properties: x.properties.toJSON(),
blacklist: x.blacklist.toJSON(),
- }).to.deep.equal({
+ }).toEqual({
keymaps: {},
search: {
default: "google",
@@ -41,15 +40,15 @@ describe("Settings", () => {
it("sets default settings", () => {
const value = Settings.fromJSON({});
- expect(value.keymaps.toJSON()).to.not.be.empty;
- expect(value.properties.toJSON()).to.not.be.empty;
- expect(value.search.defaultEngine).to.be.a("string");
- expect(value.search.engines).to.be.an("object");
- expect(value.blacklist.toJSON()).to.be.empty;
+ expect(value.keymaps.toJSON()).not.toEqual({});
+ expect(value.properties.toJSON()).not.toEqual({});
+ expect(typeof value.search.defaultEngine).toEqual("string");
+ expect(typeof value.search.engines).toEqual("object");
+ expect(value.blacklist.toJSON()).toHaveLength(0);
});
it("throws a TypeError with an unknown field", () => {
- expect(() => Settings.fromJSON({ name: "alice" })).to.throw(TypeError);
+ expect(() => Settings.fromJSON({ name: "alice" })).toThrow(TypeError);
});
});
});