You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

localHostOrDomainIs.js 642B

12345678910111213141516171819202122232425
  1. /**
  2. * Module dependencies.
  3. */
  4. var assert = require('assert');
  5. var localHostOrDomainIs = require('../localHostOrDomainIs');
  6. describe('localHostOrDomainIs(host, hostdom)', function () {
  7. var tests = [
  8. ["www.netscape.com", "www.netscape.com", true],
  9. ["www", "www.netscape.com", true],
  10. ["www.mcom.com", "www.netscape.com", false],
  11. ["home.netscape.com", "www.netscape.com", false]
  12. ];
  13. tests.forEach(function (test) {
  14. var expected = test.pop();
  15. it('should return `' + expected +'` for "' + test.join('", "') + '"', function () {
  16. assert.equal(expected, localHostOrDomainIs(test[0], test[1]));
  17. });
  18. });
  19. });