A fork of https://github.com/ueokande/vim-vixen
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
751 B
26 lines
751 B
7 years ago
|
import { expect } from "chai";
|
||
|
import { validate } from '../../../src/shared/validators/setting';
|
||
|
|
||
|
describe("setting validator", () => {
|
||
|
describe("unknown top keys", () => {
|
||
|
it('throws an error for unknown settings', () => {
|
||
|
let settings = { keymaps: {}, poison: 123 };
|
||
|
let fn = validate.bind(undefined, settings)
|
||
|
expect(fn).to.throw(Error, 'poison');
|
||
|
})
|
||
|
});
|
||
|
|
||
|
describe("keymaps settings", () => {
|
||
|
it('throws an error for unknown operation', () => {
|
||
|
let settings = {
|
||
|
keymaps: {
|
||
|
a: { 'type': 'scroll.home' },
|
||
|
b: { 'type': 'poison.dressing' },
|
||
|
}
|
||
|
};
|
||
|
let fn = validate.bind(undefined, settings)
|
||
|
expect(fn).to.throw(Error, 'poison.dressing');
|
||
|
});
|
||
|
});
|
||
|
});
|