diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-12-03 10:02:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-03 10:02:37 +0000 |
commit | 3c7230c3036e8bb2b2e9a752be9b0ef4a0a7349d (patch) | |
tree | 8c1bb889656f06ee6bc018ae053cf35e12613dfb /test/shared/settings | |
parent | feac179504a9276ad2e841702bf3fc1d89251679 (diff) | |
parent | 5205da572980f24d1632d0fa7df85124322ca960 (diff) |
Merge pull request #684 from ueokande/jsonschema-settings
Parse settings by JSON Schema
Diffstat (limited to 'test/shared/settings')
-rw-r--r-- | test/shared/settings/Blacklist.test.ts | 18 | ||||
-rw-r--r-- | test/shared/settings/Keymaps.test.ts | 1 | ||||
-rw-r--r-- | test/shared/settings/Search.test.ts | 13 |
3 files changed, 0 insertions, 32 deletions
diff --git a/test/shared/settings/Blacklist.test.ts b/test/shared/settings/Blacklist.test.ts index 133112c..0112757 100644 --- a/test/shared/settings/Blacklist.test.ts +++ b/test/shared/settings/Blacklist.test.ts @@ -16,16 +16,6 @@ describe('BlacklistItem', () => { expect(item.partial).to.be.true; expect(item.keys).to.deep.equal(['j', 'k']); }); - - it('throws a TypeError', () => { - expect(() => BlacklistItem.fromJSON(null)).to.throw(TypeError); - expect(() => BlacklistItem.fromJSON(100)).to.throw(TypeError); - expect(() => BlacklistItem.fromJSON({})).to.throw(TypeError); - expect(() => BlacklistItem.fromJSON({url: 'google.com'})).to.throw(TypeError); - expect(() => BlacklistItem.fromJSON({keys: ['a']})).to.throw(TypeError); - expect(() => BlacklistItem.fromJSON({url: 'google.com', keys: 10})).to.throw(TypeError); - expect(() => BlacklistItem.fromJSON({url: 'google.com', keys: ['a', 'b', 3]})).to.throw(TypeError); - }); }); describe('#matches', () => { @@ -118,14 +108,6 @@ describe('Blacklist', () => { let blacklist = Blacklist.fromJSON([]); expect(blacklist.toJSON()).to.deep.equals([]); }); - - it('throws a TypeError', () => { - expect(() => Blacklist.fromJSON(null)).to.throw(TypeError); - expect(() => Blacklist.fromJSON(100)).to.throw(TypeError); - expect(() => Blacklist.fromJSON({})).to.throw(TypeError); - expect(() => Blacklist.fromJSON([100])).to.throw(TypeError); - expect(() => Blacklist.fromJSON([{}])).to.throw(TypeError); - }) }); describe('#includesEntireBlacklist', () => { diff --git a/test/shared/settings/Keymaps.test.ts b/test/shared/settings/Keymaps.test.ts index 7896a63..9e4109f 100644 --- a/test/shared/settings/Keymaps.test.ts +++ b/test/shared/settings/Keymaps.test.ts @@ -19,7 +19,6 @@ describe('Keymaps', () => { }); it('throws a TypeError by invalid settings', () => { - expect(() => Keymaps.fromJSON(null)).to.throw(TypeError); expect(() => Keymaps.fromJSON({ k: { type: "invalid.operation" }, })).to.throw(TypeError); diff --git a/test/shared/settings/Search.test.ts b/test/shared/settings/Search.test.ts index 7c9134d..51cd3eb 100644 --- a/test/shared/settings/Search.test.ts +++ b/test/shared/settings/Search.test.ts @@ -26,19 +26,6 @@ describe('Search', () => { }); it('throws a TypeError by invalid settings', () => { - expect(() => Search.fromJSON(null)).to.throw(TypeError); - expect(() => Search.fromJSON({})).to.throw(TypeError); - expect(() => Search.fromJSON([])).to.throw(TypeError); - expect(() => Search.fromJSON({ - default: 123, - engines: {} - })).to.throw(TypeError); - expect(() => Search.fromJSON({ - default: 'google', - engines: { - 'google': 123456, - } - })).to.throw(TypeError); expect(() => Search.fromJSON({ default: 'wikipedia', engines: { |