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.

dnsDomainIs.js 551B

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