Skip to content

Commit

Permalink
This test seems to be failing because nslookup of non-existing-domain…
Browse files Browse the repository at this point in the history
….orkes.io actually resolves to A
  • Loading branch information
jmigueprieto committed Jan 16, 2025
1 parent 5f1e3e9 commit 5cdb66c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/orkes/request/fetchCatchDns/__test__/DnsCache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ import { expect, describe, test } from "@jest/globals";
import { DnsCacheResolver } from "../DnsCache";

const sampleDomain = "orkes.io";
const nonExistingDomain = "non-existing-domain.orkes.io";
const nonExistingDomain = "non-existing-domain.orkesdemo.io";

describe("dnsResolver", () => {
test("Should resolve dns", async () => {
const dnsCacheResolver1 = new DnsCacheResolver();
const ip = await dnsCacheResolver1.resolve(sampleDomain);
console.log(`${sampleDomain} resolved to ip: ${ip}`);
expect(ip).toBeDefined();
expect(dnsCacheResolver1.cache.size).toBe(1);
});

test("Should return empty if domain could not be resolved", async () => {
const dnsCacheResolver2 = new DnsCacheResolver();
const ip = await dnsCacheResolver2.resolve(nonExistingDomain);
console.log(`${nonExistingDomain} resolved to ip: ${ip}`);
expect(ip).not.toBeDefined();
expect(dnsCacheResolver2.cache.size).toBe(0);
});
Expand Down

0 comments on commit 5cdb66c

Please sign in to comment.