aboutsummaryrefslogtreecommitdiff
path: root/test/settings/reducers/setting.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/settings/reducers/setting.test.ts
parent11d6d725eee2ac0a1c16e4c7a4ce4f296bb6b016 (diff)
Do not use chai on unit test
Diffstat (limited to 'test/settings/reducers/setting.test.ts')
-rw-r--r--test/settings/reducers/setting.test.ts23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/settings/reducers/setting.test.ts b/test/settings/reducers/setting.test.ts
index 34e76e2..85b55ee 100644
--- a/test/settings/reducers/setting.test.ts
+++ b/test/settings/reducers/setting.test.ts
@@ -1,6 +1,5 @@
import * as actions from "../../../src/settings/actions";
import settingReducer from "../../../src/settings/reducers/setting";
-import { expect } from "chai";
import {
FormSettings,
JSONTextSettings,
@@ -11,8 +10,8 @@ import { DefaultSetting } from "../../../src/shared/settings/Settings";
describe("settings setting reducer", () => {
it("return the initial state", () => {
const state = settingReducer(undefined, {} as any);
- expect(state).to.have.deep.property("source", "json");
- expect(state).to.have.deep.property("error", "");
+ expect(state).toHaveProperty("source", "json");
+ expect(state).toHaveProperty("error", "");
});
it("return next state for SETTING_SET_SETTINGS", () => {
@@ -23,9 +22,9 @@ describe("settings setting reducer", () => {
form: FormSettings.fromSettings(DefaultSetting),
};
const state = settingReducer(undefined, action);
- expect(state.source).to.equal("json");
- expect(state.json!.toJSONText()).to.equal('{ "key": "value" }');
- expect(state.form).to.deep.equal(action.form);
+ expect(state.source).toEqual("json");
+ expect(state.json!.toJSONText()).toEqual('{ "key": "value" }');
+ expect(state.form).toEqual(action.form);
});
it("return next state for SETTING_SHOW_ERROR", () => {
@@ -35,8 +34,8 @@ describe("settings setting reducer", () => {
json: JSONTextSettings.fromText("{}"),
};
const state = settingReducer(undefined, action);
- expect(state.error).to.equal("bad value");
- expect(state.json!.toJSONText()).to.equal("{}");
+ expect(state.error).toEqual("bad value");
+ expect(state.json!.toJSONText()).toEqual("{}");
});
it("return next state for SETTING_SWITCH_TO_FORM", () => {
@@ -45,8 +44,8 @@ describe("settings setting reducer", () => {
form: FormSettings.fromSettings(DefaultSetting),
};
const state = settingReducer(undefined, action);
- expect(state.form).to.deep.equal(action.form);
- expect(state.source).to.equal("form");
+ expect(state.form).toEqual(action.form);
+ expect(state.source).toEqual("form");
});
it("return next state for SETTING_SWITCH_TO_JSON", () => {
@@ -55,7 +54,7 @@ describe("settings setting reducer", () => {
json: JSONTextSettings.fromText("{}"),
};
const state = settingReducer(undefined, action);
- expect(state.json!.toJSONText()).to.equal("{}");
- expect(state.source).to.equal(SettingSource.JSON);
+ expect(state.json!.toJSONText()).toEqual("{}");
+ expect(state.source).toEqual(SettingSource.JSON);
});
});