Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK] chore: fix all await expect tests #6359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Feb 27, 2025


PR-Codex overview

This PR focuses on updating dependencies, improving test assertions, and adding mock storage functionality. It also includes some refactoring of test cases for better readability and error handling.

Detailed summary

  • Updated happy-dom from 16.8.1 to 17.1.8.
  • Refactored test assertions to use await expect(...) directly.
  • Introduced IS_TEST constant in process.ts for test environment checks.
  • Added mock storage functions in mock.ts for managing test data.
  • Skipped specific tests that need manual execution.
  • Improved error handling in various tests related to NFT and token fetching.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Feb 27, 2025

⚠️ No Changeset found

Latest commit: 8f33fc6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Feb 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 7:09pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 7:09pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 7:09pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 7:09pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 7:09pm

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Feb 27, 2025
Copy link
Member Author

joaquim-verges commented Feb 27, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@joaquim-verges joaquim-verges changed the title [thirdweb] chore: Update vitest to 3.0.7 [thirdweb] chore: fix all await expect tests Feb 27, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review February 27, 2025 09:29
@joaquim-verges joaquim-verges requested review from a team as code owners February 27, 2025 09:29
Copy link

socket-security bot commented Feb 27, 2025

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] Transitive: environment, filesystem, shell, unsafe +34 4.42 MB antfu, oreanno, patak, ...1 more

🚮 Removed packages: npm/[email protected]

View full report↗︎

Have feedback? Participate in our User Experience Survey 📊

@joaquim-verges joaquim-verges changed the title [thirdweb] chore: fix all await expect tests [SDK] chore: fix all await expect tests Feb 27, 2025
Copy link
Contributor

github-actions bot commented Feb 27, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.74 KB (+0.23% 🔺) 935 ms (+0.23% 🔺) 200 ms (+137.64% 🔺) 1.2 s
thirdweb (cjs) 124.65 KB (+0.08% 🔺) 2.5 s (+0.08% 🔺) 268 ms (+17.67% 🔺) 2.8 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 112 ms (0%) 61 ms (+899.84% 🔺) 173 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 29 ms (+901.07% 🔺) 39 ms
thirdweb/react (minimal + tree-shaking) 19.38 KB (+0.18% 🔺) 388 ms (+0.18% 🔺) 40 ms (+98.49% 🔺) 427 ms

@@ -53,7 +47,7 @@
"@cloudflare/workers-types": "4.20250224.0",
"@types/node": "22.13.5",
"typescript": "5.7.3",
"vitest": "3.0.7"
"vitest": "3.0.5"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description indicates upgrading vitest to 3.0.7, but this change downgrades it to 3.0.5. This appears to be an unintentional version change that conflicts with the PR's stated goal. The version should be "vitest": "3.0.7" to maintain consistency with the PR description.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@joaquim-verges joaquim-verges force-pushed the _thirdweb_fix_Update_contract_ABI_caching_strategy branch from 40784a2 to 0c0e60f Compare February 27, 2025 11:53
@joaquim-verges joaquim-verges force-pushed the _thirdweb_chore_Update_vitest_to_3.0.7 branch from 94dc47c to cc54a8f Compare February 27, 2025 11:54
@joaquim-verges joaquim-verges force-pushed the _thirdweb_fix_Update_contract_ABI_caching_strategy branch from 0c0e60f to cf2fa98 Compare February 27, 2025 11:56
@joaquim-verges joaquim-verges force-pushed the _thirdweb_chore_Update_vitest_to_3.0.7 branch from cc54a8f to 311aa46 Compare February 27, 2025 11:56
@@ -226,7 +186,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("TokenERC1155", () => {
expect(isMintAdditionalSupplyToSupported(selectors)).toBe(true);
});

it("should mint multiple tokens in one tx", async () => {
it.only("should mint multiple tokens in one tx", async () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .only modifier will cause the test suite to run only this single test, skipping all others. This appears unintentional since the changes are focused on updating test assertions. Please remove .only to ensure the full test suite runs properly.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +13 to +16
const files = value.getAll("file") as File[];
if (!files) {
throw new Error("No file found in FormData");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FormData.getAll() always returns an array, even when empty, so !files will never be true. Consider checking files.length === 0 to properly detect when no files are present.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant