diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-10-10 01:42:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-10 01:42:37 +0000 |
commit | dfcefe1b84cc96ead1c8d8f9aa65ff05ccd70378 (patch) | |
tree | 12f1a4ed6da8fd96c034d23bcf08b1535bca1113 /test/settings/reducers/setting.test.ts | |
parent | 24f4f06db6572d81cadfe191f36c433a79985871 (diff) | |
parent | 039095e18562c44edda2c5a83a3d82c2e220b370 (diff) |
Merge pull request #1267 from ueokande/move-to-jest
Move to Jest
Diffstat (limited to 'test/settings/reducers/setting.test.ts')
-rw-r--r-- | test/settings/reducers/setting.test.ts | 23 |
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); }); }); |