is-domain-alive.test.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import { describe, it } from 'mocha';
  2. import { isDomainAlive, noWhois } from './is-domain-alive';
  3. import { expect } from 'expect';
  4. import process from 'node:process';
  5. describe('whoisExists', () => {
  6. it('.cryptocrawler.io', () => {
  7. expect(noWhois({
  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('Domain not found.');
  19. });
  20. it('.tunevideo.ru', () => {
  21. expect(noWhois({
  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('No entries found for the selected source(s).');
  36. });
  37. });
  38. describe('isDomainAlive', function () {
  39. this.timeout(10000);
  40. // it('.cryptocrawler.io', async () => {
  41. // expect((await isDomainAlive('.cryptocrawler.io', true))[1]).toEqual(false);
  42. // });
  43. // it('.tunevideo.ru', async () => {
  44. // expect((await isDomainAlive('.tunevideo.ru', true))[1]).toEqual(false);
  45. // });
  46. // it('.myqloud.com', async () => {
  47. // expect((await isDomainAlive('.myqloud.com', true))[1]).toEqual(true);
  48. // });
  49. // it('discount-deal.org', async () => {
  50. // expect((await isDomainAlive('discount-deal.org', false))[1]).toEqual(false);
  51. // });
  52. // it('ithome.com.tw', async () => {
  53. // expect((await isDomainAlive('ithome.com.tw', false))[1]).toEqual(true);
  54. // });
  55. // it('flipkart.com', async () => {
  56. // expect((await isDomainAlive('flipkart.com', false))[1]).toEqual(true);
  57. // });
  58. // it('lzzyimg.com', async () => {
  59. // expect((await isDomainAlive('.lzzyimg.com', true))[1]).toEqual(true);
  60. // });
  61. // it('tayfundogdas.me', async () => {
  62. // expect((await isDomainAlive('.tayfundogdas.me', true))[1]).toEqual(true);
  63. // });
  64. it('9s6q.cn', async () => {
  65. process.env.DEBUG = 'true';
  66. expect((await isDomainAlive('.9s6q.cn', true))[1]).toEqual(false);
  67. });
  68. });