/api

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Pythagora Logo

Pythagora API server


This is Pythagora API server repository which is currently handling exporting of Pythagora tests to Jest and generation of unit tests in Jest. It will be updated with future features that require LLMs.

If you want to see Pythagora npm package click here.

⚙️ Installation

First install all npm dependencies
npm install

Create .env using .example.env as an example and then you are ready to start server:

node app.js

NOTE: you need to have MongoDB connection for server to run

▶️ Usage

Server should be now running on http://localhost:3000 which means you can start exporting Pythagora tests to Jest. If you are using this in combination with Pythagora npm package make sure that you add --pythagora-api-server flag, for example when you want to create unit tests, like this:

npx pythagora --unit-tests --pythagora-api-server http://localhost:3000

or when you want to export integration tests to Jest, then like this:

npx pythagora --export --test-id <TEST_ID> --pythagora-api-server http://localhost:3000



🗄️ Folder structure

  • const
  • helpers
    • express.js // express middlewares
    • openai.js // logic for making openai requests and piping back stream data
  • models
  • prompts
    • generateJestAuth.txt // prompt for generating Jest authentication function
    • generateJestTest.txt // prompt for generating Jest test from Pythagora test
    • generateJestTestName.txt // prompt for generating Jest test name
  • routes
    • api.js
    • auth.js
    • index.js
  • utils
  • app.js // file to start server


🔗 Connect with us

💬 Join the discussion on our Discord server.

📨 Get updates on new fetures and beta release by adding your email here.

⭐ Star this repo to show support.