Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('unbinds \'any-character\'', function () {
var element = makeElement()
var spy = sinon.spy()
var combokeys = new Combokeys(element)
combokeys.bind('any-character', spy)
KeyEvent.simulate('a'.charCodeAt(0), 65, null, element)
assert.strictEqual(spy.callCount, 1, 'just checking the callback')
combokeys.unbind('any-character')
KeyEvent.simulate('a'.charCodeAt(0), 65, null, element)
KeyEvent.simulate('b'.charCodeAt(0), 66, null, element)
assert.strictEqual(spy.callCount, 1, 'unbound')
})
it('should call the `_run` method with the URL, an empty options object, and the callback', function () {
assert.calledOnce(instance._run);
assert.strictEqual(instance._run.firstCall.args[0], url);
assert.deepEqual(instance._run.firstCall.args[1], {});
assert.strictEqual(instance._run.firstCall.args[2], done);
});
});
it('should call the `_run` method with `options.url`, the options (minus URL), and the callback', function () {
assert.calledOnce(instance._run);
assert.strictEqual(instance._run.firstCall.args[0], options.url);
assert.deepEqual(instance._run.firstCall.args[1], options);
assert.strictEqual(instance._run.firstCall.args[2], done);
});
});
it('should add the passed in rule to the rules property', function () {
assert.lengthEquals(linter.rules, 2);
assert.strictEqual(linter.rules[0], rule1);
assert.strictEqual(linter.rules[1], rule2);
});
it('should add the passed in rule to the rules property', function () {
assert.lengthEquals(linter.rules, 2);
assert.strictEqual(linter.rules[0], rule1);
assert.strictEqual(linter.rules[1], rule2);
});