is-domain-alive.test.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import { describe, it } from 'mocha';
  2. import { isDomainAlive, whoisExists } from './is-domain-alive';
  3. import { expect } from 'expect';
  4. import process from 'node:process';
  5. describe('whoisExists', () => {
  6. it('.cryptocrawler.io', () => {
  7. expect(whoisExists({
  8. 'whois.nic.io': {
  9. 'Domain Status': [],
  10. 'Name Server': [],
  11. '>>> Last update of WHOIS database': '2025-01-05T11:06:38Z <<<',
  12. text: [
  13. 'Domain not found.',
  14. '',
  15. 'Terms of Use: Access to WHOIS'
  16. ]
  17. }
  18. })).toBe(false);
  19. });
  20. it('.tunevideo.ru', () => {
  21. expect(whoisExists({
  22. 'whois.tcinet.ru': {
  23. 'Domain Status': [],
  24. 'Name Server': [],
  25. text: [
  26. '% TCI Whois Service. Terms of use:',
  27. '% https://tcinet.ru/documents/whois_ru_rf.pdf (in Russian)',
  28. '% https://tcinet.ru/documents/whois_su.pdf (in Russian)',
  29. '',
  30. 'No entries found for the selected source(s).',
  31. '',
  32. 'Last updated on 2025-01-05T11:03:01Z'
  33. ]
  34. }
  35. })).toBe(false);
  36. });
  37. it('.myqloud.com', () => {
  38. expect(whoisExists({
  39. 'whois.tcinet.ru': {
  40. 'Domain Status': [],
  41. 'Name Server': [],
  42. text: [
  43. '% TCI Whois Service. Terms of use:',
  44. '% https://tcinet.ru/documents/whois_ru_rf.pdf (in Russian)',
  45. '% https://tcinet.ru/documents/whois_su.pdf (in Russian)',
  46. '',
  47. 'No entries found for the selected source(s).',
  48. '',
  49. 'Last updated on 2025-01-05T11:03:01Z'
  50. ]
  51. }
  52. })).toBe(false);
  53. });
  54. });
  55. describe('isDomainAlive', function () {
  56. this.timeout(10000);
  57. // it('.cryptocrawler.io', async () => {
  58. // expect((await isDomainAlive('.cryptocrawler.io', true))[1]).toEqual(false);
  59. // });
  60. // it('.tunevideo.ru', async () => {
  61. // expect((await isDomainAlive('.tunevideo.ru', true))[1]).toEqual(false);
  62. // });
  63. // it('.myqloud.com', async () => {
  64. // expect((await isDomainAlive('.myqloud.com', true))[1]).toEqual(true);
  65. // });
  66. // it('discount-deal.org', async () => {
  67. // expect((await isDomainAlive('discount-deal.org', false))[1]).toEqual(false);
  68. // });
  69. // it('ithome.com.tw', async () => {
  70. // expect((await isDomainAlive('ithome.com.tw', false))[1]).toEqual(true);
  71. // });
  72. // it('flipkart.com', async () => {
  73. // expect((await isDomainAlive('flipkart.com', false))[1]).toEqual(true);
  74. // });
  75. // it('lzzyimg.com', async () => {
  76. // expect((await isDomainAlive('.lzzyimg.com', true))[1]).toEqual(true);
  77. // });
  78. // it('tayfundogdas.me', async () => {
  79. // expect((await isDomainAlive('.tayfundogdas.me', true))[1]).toEqual(true);
  80. // });
  81. it('hamdandates.com', async () => {
  82. process.env.DEBUG = 'true';
  83. expect((await isDomainAlive('.hamdandates.com', true))[1]).toEqual(false);
  84. });
  85. });