From b77a4734985722e96066e713f3b1b9e81a6e1811 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Mon, 7 Oct 2019 12:43:55 +0000 Subject: [PATCH] Use Settings.toJSON on test --- test/shared/SettingData.test.ts | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/test/shared/SettingData.test.ts b/test/shared/SettingData.test.ts index d95c271..5de7770 100644 --- a/test/shared/SettingData.test.ts +++ b/test/shared/SettingData.test.ts @@ -58,12 +58,7 @@ describe('shared/SettingData', () => { }`; let settings = JSONTextSettings.fromText(o).toSettings(); - expect({ - keymaps: settings.keymaps.toJSON(), - search: settings.search.toJSON(), - properties: settings.properties.toJSON(), - blacklist: settings.blacklist.toJSON(), - }).to.deep.equal(JSON.parse(o)); + expect(settings.toJSON()).to.deep.equal(JSON.parse(o)); }); }); @@ -86,12 +81,7 @@ describe('shared/SettingData', () => { }); let json = JSONTextSettings.fromSettings(o).toJSONText(); - expect(JSON.parse(json)).to.deep.equal({ - keymaps: o.keymaps.toJSON(), - search: o.search.toJSON(), - properties: o.properties.toJSON(), - blacklist: o.blacklist.toJSON(), - }); + expect(JSON.parse(json)).to.deep.equal(o.toJSON()); }); }); }); @@ -119,12 +109,7 @@ describe('shared/SettingData', () => { }; let settings = FormSettings.fromJSON(data).toSettings(); - expect({ - keymaps: settings.keymaps.toJSON(), - search: settings.search.toJSON(), - properties: settings.properties.toJSON(), - blacklist: settings.blacklist.toJSON(), - }).to.deep.equal({ + expect(settings.toJSON()).to.deep.equal({ keymaps: { 'j': { type: 'scroll.vertically', count: 1 }, '0': { type: 'scroll.home' },