Test Gru
Contribute to mgl-sh21/testgru-example development by creating an account on GitHub.
mgl-sh21
README
Forget about Unit Test, you get covered automatically.
This is the example repo for Test Gru. Test Gru will help you add unit test automatically. Here is the video to show how Test Gru works.
Test gru is still in testing phase. If you have any question, please connect to us: connect@gru.ai,or join our discord.
Currently, Test Gru only supports Node.js/TypeStript. We are gradually adding support for other languages.
Creat Test Gru Account
Log in at Gru.ai. Test Gru currently only supports use with GitHub accounts. You need a GitHub account to log in to gru.ai.
Enter Test Gru
Click the top left corner to select Test Gru.
Install Github Application
Follow the steps to install Test Gru.
Then select a repo, perform the configuration.
Use Example For Quick Start
- Fork this repo
- Install App and get configuration from code repo
- dispatch src/user.ts
- Test Gru submits a PR
grutest.yaml
Configuration file example
version: "0.1"
global:
setup:
- npm install
pipeline:
runTest:
// If your project uses ESLint and Prettier, you can configure the pre-stage here.
// pre:
// - npx eslint --fix {{sourceFilePath}}
// - npx prettier {{sourceFilePath}} --write
exec:
- npx vitest run {{testFilePath}}
// If your project has certain requirements for the final submitted code, you can configure the post-stage here.
// post:
// - npm run lint
// - npx tsc --noEmit
settings:
// IF you allow TestGru to add export to your source code classes or functions when it needs to test your source code
exportFunctionOrClass: allow
// Location of the source code project
include:
- src
// Location of the test files
testPlacementStrategies:
- type: co-located
testFilePattern: "{{sourceFileName}}.spec.ts"
explanation
Name | Type | Required | Example Value or Default Value | Description |
---|---|---|---|---|
version |
string | No | 0.1 |
Version infomation |
global |
object | Required | - | Global confignation |
global.setup |
array | Required | - | Configuration Actions |
global.cleanup |
array | No | - | Cleanup Actions |
pipeline |
PipelineConfig | Required | - | Pipeline Configuration |
pipeline.runTest |
object | Required | - | Run Test Configuration |
pipeline.runTest.exec |
array | Required | - | Execute Command |
pipeline.runTest.pre |
array | No | - | Preprocessing Command |
pipeline.runTest.post |
array | No | - | Post-processing Command |
pipeline.updateSource |
object | No | - | Update Source Configuration |
pipeline.updateSource.post |
array | Required | - | Update Preprocessing Command |
settings |
SettingsConfig | No | - | Set Configuration |
settings.exportFunctionOrClass |
string (allow not-allow ) |
"allow" |
- | Set Configuration |
settings.include |
array | No | src | Inclusions |
settings.mockIgnore |
array | No | ["lodash", "ajv"] |
Mock Exclusions |
settings.testPlacementStrategies |
array | No | The next chapter mainly introduces | Test Placement Strategy |
About testPlacementStrategies
There are two main ways to organize test code.
centralized
If your project structure is as follows:
{% highlight TXT %} . ├── package.json ├── src │ └── sum.ts └── test └── sum.test.ts {% endhighlight %}
then you can configure testPlacementStrategies
like this
{% highlight YAML %}
testPlacementStrategies:
- type: centralized testDir: test testFilePattern: "{{sourceFileName}}.test.ts" {% endhighlight %}
co-located
If your project structure is as follows: {% highlight TXT %} . ├── package.json └── src ├── sum.test.ts └── sum.ts {% endhighlight %}
then you can configure testPlacementStrategies
like this
{% highlight YAML %} testPlacementStrategies: - type: co-located testFilePattern: "{{sourceFileName}}.test.ts" {% endhighlight %}
Trigger Test Gru to work
Auto Rrigger by Pull Request
When you complete the configuration, Test Gru will automatically take over your repository. Whenever you submit a PR, Test Gru will automatically detect software that requires unit tests and add tests for it.
After Gru completes writing the test code, it will run the tests. Once it confirms there are no issues with the test code, it will submit a PR with the unit test code to the current PR.
Manual Trigger
You can manually trigger Test Gru on the Gru.ai.
It can be triggered by PR or existing code files.
Recommended Servers
AIO-MCP Server
🚀 All-in-one MCP server with AI search, RAG, and multi-service integrations (GitLab/Jira/Confluence/YouTube) for AI-enhanced development workflows. Folk from
React MCP
react-mcp integrates with Claude Desktop, enabling the creation and modification of React apps based on user prompts
Aindreyway Codex Keeper
Serves as a guardian of development knowledge, providing AI assistants with curated access to latest documentation and best practices.
Database Explorer
A powerful Model Context Protocol (MCP) tool for exploring and managing different types of databases including PostgreSQL, MySQL, and Firestore.

Project Handoffs
Facilitates AI session handoffs and next steps tracking through project-based organization, supporting task prioritization and seamless workflow management.

Code Knowledge Tool
Provides a project memory bank and RAG context provider for enhanced code understanding and management through vector embeddings, integrated with RooCode and Cline.

Universal Source Management System
Server for managing academic literature with structured note-taking and organization, designed for seamless interaction with Claude. Built with SQLite for simplicity and portability.
OSP Marketing Tools
Enables seamless integration with any LLM client supporting MCP for creating and optimizing technical content and product positioning using Open Strategy Partners' methodologies.
Neurolora Code Collector
MCP server for collecting code from files and directories into a single markdown document.
Software Planning
Provides software development planning tools to help users create implementation plans and manage todo items.