Skip to content

test: add unit tests generated by ToTheos#12

Open
ToTheos-Dev wants to merge 20 commits into
thirdweb-example:mainfrom
ToTheos-Forks:totheos-tests/2026-05-18T08-39-39-777Z
Open

test: add unit tests generated by ToTheos#12
ToTheos-Dev wants to merge 20 commits into
thirdweb-example:mainfrom
ToTheos-Forks:totheos-tests/2026-05-18T08-39-39-777Z

Conversation

@ToTheos-Dev
Copy link
Copy Markdown

AI-Generated Unit Tests

This PR adds AI-generated unit tests to improve coverage and ensure key functionality is tested.

Test coverage summary
Statements : 98.03% ( 300/306 )
Branches   : 94.4% ( 135/143 )
Functions  : 93.1% ( 54/58 )
Lines      : 98.63% ( 290/294 )

Coverage metrics generated by Jest, an open-source JavaScript testing framework.
Test files and commits
  • test: add config
  • test: add src/lib/utils.test.ts
  • test: add src/lib/constants.test.ts
  • test: add src/lib/erc721.test.ts
  • test: add src/lib/erc20.test.ts
  • test: add src/lib/erc1155.test.ts
  • test: add src/lib/thirdwebClient.test.ts
  • test: add src/app/page.test.tsx
  • test: add src/app/layout.test.tsx
  • test: add src/components/nft-mint.test.tsx
  • test: add src/components/ui/switch.test.tsx
  • test: add src/components/ui/label.test.tsx
  • test: add src/components/ui/card.test.tsx
  • test: add src/components/ui/toast.test.tsx
  • test: add src/components/ui/input.test.tsx
  • test: add src/components/ui/toaster.test.tsx
  • test: add src/components/ui/skeleton.test.tsx
  • test: add src/components/ui/button.test.tsx
  • test: add src/hooks/use-toast.test.ts
  • test: add src/hooks/useNftData.test.ts
How to run tests

Jest is included as a dev dependency.

Run tests directly

./node_modules/.bin/jest

Optional: add npm scripts

You can add convenient scripts to package.json:

{
  "scripts": {
    "test": "jest",
    "test:watch": "jest --watch",
    "test:coverage": "jest --coverage --coverageReporters=text-summary"
  }
}

Usage examples

Run tests once:

yarn test

Run tests in watch mode during development:

yarn test:watch

Run tests with coverage summary:

yarn test:coverage

This contribution was created with assistance from ToTheos (https://totheos.com) to support test generation, code refactoring, and pull request preparation for an open-source codebases.

The tool was used to automate routine software development tasks.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@TESTPERSONAL is attempting to deploy a commit to the thirdweb Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedjest-environment-jsdom@​30.4.11001006295100
Addedjest@​30.4.21001007096100
Added@​types/​jest@​30.0.01001007781100
Added@​testing-library/​dom@​10.4.19910010087100
Added@​testing-library/​react@​16.3.29910010087100
Added@​testing-library/​jest-dom@​6.9.19810010089100
Addedts-jest@​29.4.9971009491100

View full report

@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/jest-environment-jsdom@30.4.1npm/entities@6.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@6.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant