Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it(desc, function () {
var i, len = pairs.length, pair;
for (i = 0; i < len; i ++) {
pair = pairs[i];
if (isNaN(pair)) {
assert.isTrue(isNaN(upcast.to(pair, 'function')));
} else {
assert.deepEqual(upcast.to(pair, 'function')(), pair);
}
}
});
}
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('defaults the options object with `pa11y.defaults`', () => {
assert.calledOnce(extend);
assert.isObject(extend.firstCall.args[0]);
assert.strictEqual(extend.firstCall.args[1], pa11y.defaults);
assert.deepEqual(extend.firstCall.args[2], options);
});
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);
});
it('exports a UA constructor', () => {
assert.isFunction(UA);
assert.isFunction(UA.prototype.getFamily);
assert.isFunction(UA.prototype.getVersion);
assert.isFunction(UA.prototype.satisfies);
assert.isFunction(UA.prototype.getBaseline);
assert.isFunction(UA.prototype.meetsBaseline);
assert.isFunction(UA.prototype.isUnknown);
assert.isFunction(UA.normalize);
assert.isFunction(UA.getBaselines);
});
it('exports a UA constructor', () => {
assert.isFunction(UA);
assert.isFunction(UA.prototype.getFamily);
assert.isFunction(UA.prototype.getVersion);
assert.isFunction(UA.prototype.satisfies);
assert.isFunction(UA.prototype.getBaseline);
assert.isFunction(UA.prototype.meetsBaseline);
assert.isFunction(UA.prototype.isUnknown);
assert.isFunction(UA.normalize);
assert.isFunction(UA.getBaselines);
});