Skip to content

jellydn/auto-testgen-nodejs

Repository files navigation

Welcome to auto-testgen-nodejs 👋

How to use AI to generate unit tests Version License: MIT

IT Man - AI-Powered Unit Testing in 2023 [Vietnamese]

Demo

https://gyazo.com/5563528f5b41d126257a573f84631097.gif

Usage

pnpm install

Setup

  1. First, add the Pythagora API key to your environment using the command:
npx pythagora --config --pythagora-api-key YOUR_API_KEY

This command will store your Pythagora API key in a config file which will be used for generating your tests.

Generating Unit Tests

  1. To generate unit tests for a specific function in your Node.js application, use the following command:
npx pythagora --unit-tests --func divide --path src/math.ts

In the above command, replace divide with the name of the function you want to test and src/math.ts with the path to the file that contains the function. The tool will automatically create a unit test for the specified function.

Note: Pythagora support Typescript file since version 0.0.36

Plan/Todo

Author

Show your support

kofi paypal buymeacoffee

Give a ⭐️ if this project helped you!