diff options
Diffstat (limited to 'test/background/usecases/parsers.test.ts')
-rw-r--r-- | test/background/usecases/parsers.test.ts | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/test/background/usecases/parsers.test.ts b/test/background/usecases/parsers.test.ts index d08de0d..bee0d07 100644 --- a/test/background/usecases/parsers.test.ts +++ b/test/background/usecases/parsers.test.ts @@ -1,34 +1,43 @@ -import * as parsers from 'background/usecases/parsers'; +import * as parsers from "background/usecases/parsers"; describe("shared/commands/parsers", () => { describe("#parsers.parseSetOption", () => { - it('parse set string', () => { - const [key, value] = parsers.parseSetOption('hintchars=abcdefgh'); - expect(key).to.equal('hintchars'); - expect(value).to.equal('abcdefgh'); + it("parse set string", () => { + const [key, value] = parsers.parseSetOption("hintchars=abcdefgh"); + expect(key).to.equal("hintchars"); + expect(value).to.equal("abcdefgh"); }); - it('parse set empty string', () => { - const [key, value] = parsers.parseSetOption('hintchars='); - expect(key).to.equal('hintchars'); - expect(value).to.equal(''); + it("parse set empty string", () => { + const [key, value] = parsers.parseSetOption("hintchars="); + expect(key).to.equal("hintchars"); + expect(value).to.equal(""); }); - it('parse set boolean', () => { - let [key, value] = parsers.parseSetOption('smoothscroll'); - expect(key).to.equal('smoothscroll'); + it("parse set boolean", () => { + let [key, value] = parsers.parseSetOption("smoothscroll"); + expect(key).to.equal("smoothscroll"); expect(value).to.be.true; - [key, value] = parsers.parseSetOption('nosmoothscroll'); - expect(key).to.equal('smoothscroll'); + [key, value] = parsers.parseSetOption("nosmoothscroll"); + expect(key).to.equal("smoothscroll"); expect(value).to.be.false; }); - it('throws error on unknown property', () => { - expect(() => parsers.parseSetOption('encoding=utf-8')).to.throw(Error, 'Unknown'); - expect(() => parsers.parseSetOption('paste')).to.throw(Error, 'Unknown'); - expect(() => parsers.parseSetOption('nopaste')).to.throw(Error, 'Unknown'); - expect(() => parsers.parseSetOption('smoothscroll=yes')).to.throw(Error, 'Invalid argument'); + it("throws error on unknown property", () => { + expect(() => parsers.parseSetOption("encoding=utf-8")).to.throw( + Error, + "Unknown" + ); + expect(() => parsers.parseSetOption("paste")).to.throw(Error, "Unknown"); + expect(() => parsers.parseSetOption("nopaste")).to.throw( + Error, + "Unknown" + ); + expect(() => parsers.parseSetOption("smoothscroll=yes")).to.throw( + Error, + "Invalid argument" + ); }); }); }); |