Skip to content

test: add unit tests generated by ToTheos#301

Open
ToTheos-Dev wants to merge 21 commits into
0xMiden:mainfrom
ToTheos-Forks:totheos-tests/2026-05-20T06-29-46-171Z
Open

test: add unit tests generated by ToTheos#301
ToTheos-Dev wants to merge 21 commits into
0xMiden:mainfrom
ToTheos-Forks:totheos-tests/2026-05-20T06-29-46-171Z

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 : 100% ( 53/53 )
Branches   : 100% ( 28/28 )
Functions  : 100% ( 24/24 )
Lines      : 100% ( 53/53 )

Coverage metrics generated by Jest, an open-source JavaScript testing framework.
Test files and commits
  • test: add config
  • test: add src/theme/Admonition/Layout/index.test.tsx
  • test: add src/theme/Admonition/index.test.tsx
  • test: add src/theme/Admonition/Types.test.tsx
  • test: add src/theme/Admonition/Type/Danger.test.tsx
  • test: add src/theme/Admonition/Type/Warning.test.tsx
  • test: add src/theme/Admonition/Type/Tip.test.tsx
  • test: add src/theme/Admonition/Type/Caution.test.tsx
  • test: add src/theme/Admonition/Type/Note.test.tsx
  • test: add src/theme/Admonition/Type/Info.test.tsx
  • test: add src/theme/Admonition/Icon/Danger.test.tsx
  • test: add src/theme/Admonition/Icon/Warning.test.tsx
  • test: add src/theme/Admonition/Icon/Tip.test.tsx
  • test: add src/theme/Admonition/Icon/Note.test.tsx
  • test: add src/theme/Admonition/Icon/Info.test.tsx
  • test: add src/theme/SearchBar.test.tsx
  • test: add src/theme/DocCard/index.test.tsx
  • test: add src/pages/index.test.tsx
  • test: add src/components/CodeTabs.test.tsx
  • test: add src/components/index.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:

npm run test

Run tests in watch mode during development:

npm run test:watch

Run tests with coverage summary:

npm run 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.

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