Skip to content

test: add unit tests generated by ToTheos#20

Open
ToTheos-Dev wants to merge 16 commits into
CashScript:mainfrom
ToTheos-Forks:totheos-tests/2026-05-20T01-14-23-244Z
Open

test: add unit tests generated by ToTheos#20
ToTheos-Dev wants to merge 16 commits into
CashScript:mainfrom
ToTheos-Forks:totheos-tests/2026-05-20T01-14-23-244Z

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 : 62.61% ( 1380/2204 )
Branches   : 41.41% ( 217/524 )
Functions  : 38.27% ( 129/337 )
Lines      : 62.77% ( 1366/2176 )

Coverage metrics generated by Jest, an open-source JavaScript testing framework.
Test files and commits
  • test: add config
  • test: add src/server.test.ts
  • test: add src/CashscriptLinter/grammar/CashScriptParser.test.ts
  • test: add src/CashscriptLinter/grammar/CashScriptVisitor.test.ts
  • test: add src/CashscriptLinter/grammar/CashScriptLexer.test.ts
  • test: add src/CashscriptLinter/CashscriptLinter.test.ts
  • test: add src/CashscriptLinter/ErrorListeners.test.ts
  • test: add src/CashscriptHoverProvider.test.ts
  • test: add src/LanguageDesc.test.ts
  • test: add src/testSetup.test.ts
  • test: add src/extension.test.ts
  • test: add src/CashscriptSignatureCompleter.test.ts
  • test: add src/CashscriptCompletionProvider.test.ts
  • test: add src/tests/runTest.test.ts
  • test: add src/tests/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:

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.

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