Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ai-tests

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-tests

## Overview

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ai-tests

Overview

ai-tests is a tool designed to assist developers in generating initial test boilerplates. It generates an initial batch of tests using LLMs based on a code file.

Although it's not always perfect, it could save you a ton of time and effort. It can provide a solid starting point for simple test suites, sometimes even generating fully working test suites on the first try!

Getting Your PolyFact Token

AI-Tests uses polyfact to generate AI responses. To use it, you need to get a polyfact token.

Follow these steps to get your PolyFact token:

  1. Go to app.polyfact.com.
  2. Connect with GitHub.
  3. Copy the token.

Then, you need to export the PolyFact token in your environment:

export POLYFACT_TOKEN=<your_polyfact_token>

Usage

To use ai-tests, pass the file path to the command as follows:

$ npx ai-tests <input_file>

The output will be a batch of tests in the programming language corresponding to the input file. You can then modify and add to these tests as needed.

Limitations

The generated tests are by no means a replacement for manually written, thoughtful test cases. The quality of tests varies - sometimes they are perfect and ready to run, and other times they serve as a starting point for further refinement. In general, be a good engineer, use the right tool for the right job.

Also, the tool currently has a limitation on file size. If a file is too large, it will generate multiple tests and concatenate them, which is, depending on the language, not always a good way of generating syntaxically valid test files.

Contribute

Of course, contributions or suggestions are always welcome! Feel free to submit a pull request or open an issue.

FAQs

Package last updated on 26 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc