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);
});
runHtmlCodeSniffer(page, opts, function (err, results) {
assert.deepEqual(results, messages);
done();
});
});
loadConfig('./config/pa11y.json', function (err, config) {
assert.isTrue(fs.readFile.withArgs(path.resolve(process.cwd(), './config/pa11y.json'), 'utf8').calledOnce);
assert.isTrue(JSON.parse.withArgs(exampleConfig).calledOnce);
assert.deepEqual(config, exampleConfigObject);
done();
});
});