Skip to content

Commit b6a6eae

Browse files
authored
chore(tests): skip tests that will fail without secret key set (#2604)
1 parent f7b45fa commit b6a6eae

File tree

20 files changed

+689
-669
lines changed

20 files changed

+689
-669
lines changed

legacy_packages/storage/test/ipfs.test.ts

Lines changed: 488 additions & 480 deletions
Large diffs are not rendered by default.

packages/thirdweb/src/contract/deployment/deploy-via-autofactory.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import { prepareAutoFactoryDeployTransaction } from "./deploy-via-autofactory.js
1212
import { initialize } from "../../extensions/prebuilts/__generated__/DropERC721/write/initialize.js";
1313
import { getDeployedInfraContract } from "./utils/infra.js";
1414

15-
describe("deployFromMetadata", () => {
15+
// skip this test suite if there is no secret key available to test with
16+
// TODO: remove reliance on secret key during unit tests entirely
17+
describe.runIf(process.env.TW_SECRET_KEY)("deployFromMetadata", () => {
1618
it("should deploy published contract with existing infra", async () => {
1719
const cloneFactoryContract = await getDeployedCloneFactoryContract({
1820
chain: FORKED_ETHEREUM_CHAIN,

packages/thirdweb/src/contract/deployment/utils/bootstrap.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import { getDeployedCreate2Factory } from "./create-2-factory.js";
77
import { getDeployedInfraContract } from "./infra.js";
88
import { fail } from "assert";
99

10-
describe("bootstrap", () => {
10+
// skip this test suite if there is no secret key available to test with
11+
// TODO: remove reliance on secret key during unit tests entirely
12+
describe.runIf(process.env.TW_SECRET_KEY)("bootstrap", () => {
1113
it("should bootstrap onchain infra", async () => {
1214
await deployCloneFactory({
1315
chain: ANVIL_CHAIN,

packages/thirdweb/src/event/actions/get-events.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import {
77
import { transferEvent } from "../../extensions/erc721/__generated__/IERC721A/events/Transfer.js";
88
import { prepareEvent } from "../prepare-event.js";
99

10-
describe("getEvents", () => {
10+
// skip this test suite if there is no secret key available to test with
11+
// TODO: remove reliance on secret key during unit tests entirely
12+
describe.runIf(process.env.TW_SECRET_KEY)("getEvents", () => {
1113
it("should get all events", async () => {
1214
const events = await getContractEvents({
1315
contract: USDC_CONTRACT,

packages/thirdweb/src/extensions/ens/resolve-address.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { describe, it, expect } from "vitest";
22
import { resolveAddress } from "./resolve-address.js";
33
import { TEST_CLIENT } from "../../../test/src/test-clients.js";
44

5-
describe("ENS", () => {
5+
// skip this test suite if there is no secret key available to test with
6+
// TODO: remove reliance on secret key during unit tests entirely
7+
describe.runIf(process.env.TW_SECRET_KEY)("ENS", () => {
68
it("should resolve ENS", async () => {
79
const name = "vitalik.eth";
810
const address = await resolveAddress({

packages/thirdweb/src/extensions/erc1155/read/getNFT.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getNFT } from "./getNFT.js";
44
import { DROP1155_CONTRACT } from "~test/test-contracts.js";
55

66
describe("erc1155.getNFT", () => {
7-
it.runIf(process.env.TW_SECRET_KEY)("without owner", async () => {
7+
it("without owner", async () => {
88
const nft = await getNFT({
99
contract: DROP1155_CONTRACT,
1010
tokenId: 2n,

packages/thirdweb/src/extensions/erc721/read/getAllOwners.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it, expect } from "vitest";
33
import { getAllOwners } from "./getAllOwners.js";
44
import { AZUKI_CONTRACT, DOODLES_CONTRACT } from "~test/test-contracts.js";
55

6-
describe.runIf(process.env.TW_SECRET_KEY)("erc721.getAllOwners", () => {
6+
describe("erc721.getAllOwners", () => {
77
it("works for azuki", async () => {
88
const nfts = await getAllOwners({
99
contract: AZUKI_CONTRACT,

packages/thirdweb/src/extensions/erc721/read/getNFT.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getNFT } from "./getNFT.js";
44
import { DOODLES_CONTRACT } from "~test/test-contracts.js";
55

66
describe("erc721.getNFT", () => {
7-
it.runIf(process.env.TW_SECRET_KEY)("without owner", async () => {
7+
it("without owner", async () => {
88
const nft = await getNFT({
99
contract: { ...DOODLES_CONTRACT },
1010
tokenId: 1n,
@@ -47,7 +47,7 @@ describe("erc721.getNFT", () => {
4747
`);
4848
});
4949

50-
it.runIf(process.env.TW_SECRET_KEY)("with owner", async () => {
50+
it("with owner", async () => {
5151
const nft = await getNFT({
5252
contract: { ...DOODLES_CONTRACT },
5353
tokenId: 1n,

packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it, expect } from "vitest";
33
import { getNFTs } from "./getNFTs.js";
44
import { AZUKI_CONTRACT, DOODLES_CONTRACT } from "~test/test-contracts.js";
55

6-
describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFTs", () => {
6+
describe("erc721.getNFTs", () => {
77
it("works for azuki", async () => {
88
const nfts = await getNFTs({
99
contract: AZUKI_CONTRACT,

packages/thirdweb/src/extensions/erc721/write/sigMint.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ import { USDC_CONTRACT_ADDRESS } from "../../../../test/src/test-contracts.js";
1616
import { toHex } from "../../../utils/encoding/hex.js";
1717
import { sendTransaction } from "../../../transaction/actions/send-transaction.js";
1818

19-
describe(
19+
// skip this test suite if there is no secret key available to test with
20+
// TODO: remove reliance on secret key during unit tests entirely
21+
describe.runIf(process.env.TW_SECRET_KEY)(
2022
"generateMintSignature",
2123
{
2224
timeout: 60000,

0 commit comments

Comments
 (0)