Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ import { resolveAddress } from "./resolveAddress.js";

// Double check: https://unstoppabledomains.com/d/thirdwebsdk.unstoppable

describe("Unstoppable Domain: resolve address", () => {
it("should resolve address", async () => {
expect(
(
await resolveAddress({
name: "thirdwebsdk.unstoppable",
client: TEST_CLIENT,
})
).toLowerCase(),
).toBe("0x12345674b599ce99958242b3D3741e7b01841DF3".toLowerCase());
});
describe.runIf(process.env.TW_SECRET_KEY)(
"Unstoppable Domain: resolve address",
() => {
it("should resolve address", async () => {
expect(
(
await resolveAddress({
name: "thirdwebsdk.unstoppable",
client: TEST_CLIENT,
})
).toLowerCase(),
).toBe("0x12345674b599ce99958242b3D3741e7b01841DF3".toLowerCase());
});

it("should throw an error with a non-existent domain name", async () => {
await expect(() =>
resolveAddress({
name: "thirdwebsdk.thissuredoesnotexist",
client: TEST_CLIENT,
}),
).rejects.toThrowError(
"Could not resolve a valid tokenId from the domain: thirdwebsdk.thissuredoesnotexist. Make sure it exists.",
);
});
});
it("should throw an error with a non-existent domain name", async () => {
await expect(() =>
resolveAddress({
name: "thirdwebsdk.thissuredoesnotexist",
client: TEST_CLIENT,
}),
).rejects.toThrowError(
"Could not resolve a valid tokenId from the domain: thirdwebsdk.thissuredoesnotexist. Make sure it exists.",
);
});
},
);
Loading