GT2/GT2-Android/node_modules/pac-resolver/test/isResolvable.js

28 lines
573 B
JavaScript
Raw Normal View History

/**
* Module dependencies.
*/
var assert = require('assert');
var isResolvable = require('../isResolvable');
describe('isResolvable(host)', function () {
var tests = [
["www.netscape.com", true],
["bogus.domain.foobar", false]
];
tests.forEach(function (test) {
var expected = test.pop();
it('should return `' + expected +'` for "' + test.join('", "') + '"', function (done) {
isResolvable(test[0], function (err, res) {
if (err) return done(err);
assert.equal(expected, res);
done();
});
});
});
});