Skip to content

Commit 512eeb5

Browse files
committed
fix: unstoppable domains test (#5389)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR modifies the test suite for resolving addresses with `Unstoppable Domain`. It updates the test structure to conditionally run based on the presence of `TW_SECRET_KEY` and retains the existing test logic. ### Detailed summary - Changed `describe` to conditionally run with `describe.runIf(process.env.TW_SECRET_KEY)`. - Retained the test for resolving a valid address. - Retained the test for handling a non-existent domain name. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent a1707f6 commit 512eeb5

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

packages/thirdweb/src/extensions/unstoppable-domains/read/resolveAddress.test.ts

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,29 @@ import { resolveAddress } from "./resolveAddress.js";
44

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

7-
describe("Unstoppable Domain: resolve address", () => {
8-
it("should resolve address", async () => {
9-
expect(
10-
(
11-
await resolveAddress({
12-
name: "thirdwebsdk.unstoppable",
13-
client: TEST_CLIENT,
14-
})
15-
).toLowerCase(),
16-
).toBe("0x12345674b599ce99958242b3D3741e7b01841DF3".toLowerCase());
17-
});
7+
describe.runIf(process.env.TW_SECRET_KEY)(
8+
"Unstoppable Domain: resolve address",
9+
() => {
10+
it("should resolve address", async () => {
11+
expect(
12+
(
13+
await resolveAddress({
14+
name: "thirdwebsdk.unstoppable",
15+
client: TEST_CLIENT,
16+
})
17+
).toLowerCase(),
18+
).toBe("0x12345674b599ce99958242b3D3741e7b01841DF3".toLowerCase());
19+
});
1820

19-
it("should throw an error with a non-existent domain name", async () => {
20-
await expect(() =>
21-
resolveAddress({
22-
name: "thirdwebsdk.thissuredoesnotexist",
23-
client: TEST_CLIENT,
24-
}),
25-
).rejects.toThrowError(
26-
"Could not resolve a valid tokenId from the domain: thirdwebsdk.thissuredoesnotexist. Make sure it exists.",
27-
);
28-
});
29-
});
21+
it("should throw an error with a non-existent domain name", async () => {
22+
await expect(() =>
23+
resolveAddress({
24+
name: "thirdwebsdk.thissuredoesnotexist",
25+
client: TEST_CLIENT,
26+
}),
27+
).rejects.toThrowError(
28+
"Could not resolve a valid tokenId from the domain: thirdwebsdk.thissuredoesnotexist. Make sure it exists.",
29+
);
30+
});
31+
},
32+
);

0 commit comments

Comments
 (0)