aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/shared/commands/parsers.test.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/shared/commands/parsers.test.js b/test/shared/commands/parsers.test.js
index 200323c..0a1960c 100644
--- a/test/shared/commands/parsers.test.js
+++ b/test/shared/commands/parsers.test.js
@@ -9,6 +9,12 @@ describe("shared/commands/parsers", () => {
expect(value).to.equal('utf-8');
});
+ it('parse set empty string', () => {
+ let [key, value] = parsers.parseSetOption('encoding=', { encoding: 'string' });
+ expect(key).to.equal('encoding');
+ expect(value).to.equal('');
+ });
+
it('parse set string', () => {
let [key, value] = parsers.parseSetOption('history=50', { history: 'number' });
expect(key).to.equal('history');
@@ -34,6 +40,7 @@ describe("shared/commands/parsers", () => {
it('throws error on invalid property', () => {
expect(() => parsers.parseSetOption('charset=utf-8', { charset: 'number' })).to.throw(Error, 'Not number');
expect(() => parsers.parseSetOption('charset=utf-8', { charset: 'boolean' })).to.throw(Error, 'Invalid');
+ expect(() => parsers.parseSetOption('charset=', { charset: 'boolean' })).to.throw(Error, 'Invalid');
expect(() => parsers.parseSetOption('smoothscroll', { smoothscroll: 'string' })).to.throw(Error, 'Invalid');
expect(() => parsers.parseSetOption('smoothscroll', { smoothscroll: 'number' })).to.throw(Error, 'Invalid');
})