aboutsummaryrefslogtreecommitdiff
path: root/test/shared/settings/Settings.test.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-10-10 01:42:37 +0000
committerGitHub <noreply@github.com>2021-10-10 01:42:37 +0000
commitdfcefe1b84cc96ead1c8d8f9aa65ff05ccd70378 (patch)
tree12f1a4ed6da8fd96c034d23bcf08b1535bca1113 /test/shared/settings/Settings.test.ts
parent24f4f06db6572d81cadfe191f36c433a79985871 (diff)
parent039095e18562c44edda2c5a83a3d82c2e220b370 (diff)
Merge pull request #1267 from ueokande/move-to-jest
Move to Jest
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);
});
});
});