Skip to content

Conversation

@NahumOchoa
Copy link

Implement TypeScript & Jest Tests

This PR refactors the codebase to use TypeScript for improved type safety and adds unit tests using Jest to ensure functionality and prevent regressions.

Key Changes:

  • Migrated source code (src/index.ts) to TypeScript with strict settings (tsconfig.json).
  • Added Jest and ts-jest, configuring them (jest.config.ts) for TypeScript and ES Modules.
  • Implemented unit tests for tools/list and tools/call (add method), covering core logic and edge cases.
  • Created test utilities (__tests__/test-utils.ts) for cleaner test mocks.
  • Updated package.json scripts (start, deploy, test) to include TypeScript compilation and necessary Node options for testing.
  • Updated README.md with current build, run, and test instructions.

Benefits:

  • Enhanced code robustness and maintainability.
  • Increased confidence through automated testing.
  • Improved developer experience.

To Test:

npm install
npm test

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