Testing Overview
Roblox Studio MCP uses a comprehensive testing strategy:- Jest Unit Tests - 32 tests covering core services and integration
- Lune E2E Tests - 30 tests verifying HTTP endpoints work correctly
- Full feature parity testing between stdio MCP and HTTP modes
Unit Tests (Jest)
Run All Unit Tests
Execute the Jest test suite:Watch Mode
Run tests in watch mode for active development:- Re-runs tests when files change
- Only runs tests related to changed files
- Interactive mode with filtering options
Coverage Report
Generate a test coverage report:- Line coverage percentage
- Branch coverage
- Function coverage
- Uncovered lines
coverage/ directory.
What Unit Tests Cover
Jest tests validate:Bridge Service (bridge-service.ts)
- Request queue management
- UUID-based request tracking
- Promise resolution/rejection
- Timeout handling (30 second default)
- Request deduplication
HTTP Server (http-server.ts)
- Express server initialization
- CORS configuration
- GET
/pollendpoint (long polling) - POST
/responseendpoint - Error handling and status codes
- JSON request/response parsing
Integration Tests
- End-to-end request/response flow
- MCP tool execution
- Studio plugin communication
- Error propagation
E2E Tests (Lune)
Prerequisites
E2E tests require:- Lune runtime installed (Luau execution environment)
- MCP server running on localhost:3002
Run E2E Tests
Start the MCP server first:What E2E Tests Cover
Lune E2E tests verify all 37+ HTTP endpoints:File System Tools
/api/file-tree- Complete hierarchy retrieval/api/search-files- File search by name/type/content
Studio Context Tools
/api/place-info- Place metadata/api/services- Roblox services listing/api/search-objects- Instance searching/api/get-selection- Current Studio selection
Property Tools
/api/instance-properties- Property retrieval/api/set-property- Single property modification/api/mass-set-property- Bulk property updates/api/mass-get-property- Bulk property reads/api/set-calculated-property- Formula-based properties/api/set-relative-property- Relative modifications
Object Creation Tools
/api/create-object- Single object creation/api/mass-create-objects- Bulk creation/api/mass-create-objects-with-properties- Bulk with properties/api/delete-object- Object deletion/api/smart-duplicate- Advanced duplication/api/mass-duplicate- Bulk duplication
Script Tools
/api/get-script-source- Read script code/api/set-script-source- Replace script/api/edit-script-lines- Edit specific lines/api/insert-script-lines- Insert new lines/api/delete-script-lines- Delete lines
Attribute & Tag Tools
/api/get-attribute- Single attribute/api/set-attribute- Set attribute (supports Vector3, Color3)/api/get-attributes- All attributes/api/delete-attribute- Remove attribute/api/get-tags- Instance tags/api/add-tag- Add tag/api/remove-tag- Remove tag/api/get-tagged- Find by tag
Advanced Tools (v2.0.0)
/api/reparent-object- Move objects/api/clone-object- Clone instances/api/get-descendants- Recursive children/api/batch-operations- Multiple operations/api/undo//api/redo- History management/api/group-objects//api/ungroup-objects- Grouping/api/get-bounding-box- Spatial calculations/api/create-weld- Weld creation/api/raycast- Raycasting/api/fill-terrain//api/clear-terrain- Terrain/api/execute-lua- Execute Lua code/api/set-selection- Modify Studio selection/api/mass-reparent- Bulk reparenting
Run All Tests
Execute both unit and E2E tests:- Jest unit tests first
- Then Lune E2E tests (if server is running)
Writing Tests
Unit Test Example
Create tests in__tests__/ or *.test.ts files:
E2E Test Example
Create Lune scripts intests/luau/:
Test Best Practices
Unit Testing
- Test one thing at a time - Each test should validate a single behavior
- Use descriptive names - Test names should explain what they validate
- Mock external dependencies - Isolate the code under test
- Test edge cases - Include error conditions and boundary cases
- Keep tests fast - Unit tests should run in milliseconds
E2E Testing
- Test real workflows - Simulate actual usage patterns
- Validate responses - Check structure and data types
- Handle timing - Account for async operations
- Clean up - Remove test objects after tests
- Document setup - Explain prerequisites clearly
Continuous Integration
When setting up CI/CD:Debugging Tests
Debug Jest Tests
Run with verbose output:Debug E2E Tests
Add debug output in Lune scripts:Next Steps
Development Setup
Set up your development environment
Plugin Development
Work on the Studio plugin