GT2/GT2-iOS/node_modules/pac-resolver/test/localHostOrDomainIs.js

26 lines
642 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
/**
* Module dependencies.
*/
var assert = require('assert');
var localHostOrDomainIs = require('../localHostOrDomainIs');
describe('localHostOrDomainIs(host, hostdom)', function () {
var tests = [
["www.netscape.com", "www.netscape.com", true],
["www", "www.netscape.com", true],
["www.mcom.com", "www.netscape.com", false],
["home.netscape.com", "www.netscape.com", false]
];
tests.forEach(function (test) {
var expected = test.pop();
it('should return `' + expected +'` for "' + test.join('", "') + '"', function () {
assert.equal(expected, localHostOrDomainIs(test[0], test[1]));
});
});
});