-
Notifications
You must be signed in to change notification settings - Fork 21
chore: add tests #103
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
base: master
Are you sure you want to change the base?
chore: add tests #103
Conversation
…Server class creation
* add help tool * Update src/tools/helpers.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: move tool text into a constant * fix: helpTool text * Update src/tools/helpers.ts Co-authored-by: Jiří Spilka <jiri.spilka@apify.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jiri Spilka <jirka.spilka@gmail.com> Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>
beforeEach(async () => { | ||
// same as in main.ts | ||
// TODO: unify | ||
server = createActorMCPServer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server is created twice. I would really remove the createActorMCPServer function. Can you handle TODO as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the createActorMCPServer
wrapper and TODO since I copied the logic from main.ts
so it's unified.
server is created twice.
You mean there is separate server for each describe
block? If so that is correct, I wanted to split the different transport tests so they can run in parallel so it spawns two server instances on different ports. Since the Actor MCP server logic is coupled and only single-tenant the actual tests (it
blocks) must run in serial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn’t have time to look at the test in detail,
but overall, it looks good. I’ve left a few comments that should be addressed before merging.
…rectly, removed duplicate tools.actor tests and renamed actor.test.ts, removed old TODOs
for each state to fix MaxListenersExceededWarning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds enhanced test coverage across unit and integration tests while also updating some helper functionality and default configurations.
- Introduces a new test timeout in the Vitest configuration
- Adds multiple unit tests for utilities and updates import paths
- Implements a help tool in the MCP server and adjusts default tool configurations
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
vitest.config.ts | Added a test timeout setting |
tests/unit/*.test.ts & tests/integration/stdio.test.ts | Added and updated unit and integration tests |
tests/helpers.ts | Introduced helper functions for various client transports |
src/tools/helpers.ts | Added a help tool with extensive inline documentation |
src/mcp/server.ts | Updated default tools and added reset/close methods |
src/const.ts | Updated default actors and helper tool configuration |
tests/actor-server-test.ts | Removed obsolete actor server tests |
tests/README.md | Added documentation for running tests |
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (2)
src/const.ts:33
- Verify that the removal of the default actor 'apify/instagram-scraper' (and related entries) is intentional, as this alters the expected configuration of default actors.
- 'apify/instagram-scraper',
src/tools/helpers.ts:12
- [nitpick] Consider externalizing the lengthy inline help text into a dedicated documentation file or module to improve maintainability and readability of the source code.
const HELP_TOOL_TEXT = `Apify MCP server help: ...
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
closes #57
closes #97
by default for
npm run test
only unit tests are executed as they do not require Apify API tokenFeatures: