npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

testagentai

v1.0.0

Published

AI-powered test generation tool

Downloads

3

Readme

TestAgentAI

TestAgentAI is an open-source AI-powered test generation tool. It leverages OpenAI's GPT models to automatically generate comprehensive unit tests for your code, saving time and improving code quality.

Features

  • AI-powered test generation using OpenAI's GPT models
  • CLI tool for seamless integration into your development workflow
  • Server component for team collaboration and centralized test management
  • Flexible storage options for test results and history
  • Support for multiple programming languages (JavaScript/TypeScript initially, with plans to expand)
  • Integration with popular testing frameworks like Jest

Getting Started

Prerequisites

  • Node.js (v14 or later)
  • OpenAI API key
  • Jest (for running generated tests)

Installation

  1. Clone the repository:

    git clone https://github.com/cravinos/TestAgentAI.git
    cd TestAgentAI
  2. Install dependencies:

    npm install
  3. Set up your OpenAI API key:

    export OPENAI_API_KEY=your_api_key_here

    Alternatively, create a .env file in the project root and add:

    OPENAI_API_KEY=your_api_key_here

Usage

To generate tests for a file:

npx ts-node packages/cli/src/index.ts path/to/your/file.js

This will generate a test file in the __tests__ directory (or a custom directory if specified) and run the tests using Jest.

Configuration

You can customize TestAgentAI behavior by creating a testagentai.config.js file in your project root:

module.exports = {
  testFramework: 'jest',
  outputDir: '__tests__',
  aiModel: 'gpt-3.5-turbo',
  // Add more configuration options as needed
};

Project Structure

TestAgentAI/
├── packages/
│   ├── cli/            # Command-line interface
│   ├── server/         # Server component for team collaboration
│   ├── test-generator/ # Core test generation logic
│   └── storage-adapters/ # Adapters for different storage options
├── __tests__/          # Tests for TestAgentAI itself
├── docs/               # Documentation
└── examples/           # Example usage and integrations

Contributing

We welcome contributions from the community! Whether it's bug fixes, feature additions, or documentation improvements, your help is appreciated. Please see our Contributing Guide for more details on how to get started.

Development Setup

  1. Fork the repository and clone your fork
  2. Install dependencies: npm install
  3. Run tests: npm test
  4. Start the development server: npm run dev

Roadmap

  • [ ] Support for additional programming languages
  • [ ] Integration with more testing frameworks
  • [ ] Web interface for test management
  • [ ] Performance optimizations for large codebases
  • [ ] AI-powered test suite analysis and recommendations

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • OpenAI for their powerful GPT models
  • The open-source community for inspiration and support

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository or reach out to the maintainers directly.

CLI Tool Usage

Now, users can install and use the TestAgentAI CLI tool in their projects:

  1. Install the tool globally:
npm install -g testagentai-cli
  1. Navigate to their project directory:
cd /path/to/their/project
  1. Run the tool on a specific file:
testagentai src/utils/someFile.js

The tool will generate tests relative to the current project structure and run them using the project's Jest installation.

Options

  • -o, --output <directory>: Specify the output directory for test files (default: "tests")

Requirements

  • Node.js 12 or higher
  • Jest installed in your project

How It Works

TestAgentAI CLI uses advanced AI to analyze your code and generate comprehensive test suites. It creates tests that cover various scenarios, including edge cases, ensuring robust test coverage for your project.


Happy testing with TestAgentAI! 🚀🤖