Reviews and quality
Unit tests for your code
Yavaren writes unit tests for your own Python and TypeScript/JavaScript functions, runs them, shows they catch deliberate defects, and proposes only the new test files as a draft pull request.
Quality › an application › Unit tests. No test environment is needed: the tests run on your runner.
Start a run
Press Write and run unit tests. You can name up to ten modules, for example src/billing/pricing.py. If you
leave this empty, Yavaren chooses up to five modules with the most testable functions.
What you get
- A test file per module, following what your repository already uses: pytest for Python, and your own Vitest for TypeScript or JavaScript. Your code is never changed.
- The run: how many tests ran and passed, as your test framework reported them.
- Coverage of the tested Python modules.
- Deliberate defects caught: Yavaren changes one comparison or number at a time in a copy of your code, then checks that a test fails. Changes no test noticed are listed.
- A draft pull request with only the new test files.
Read each test's comment
| Comment | Meaning |
|---|---|
| From approved criteria | the behaviour your approved requirement describes |
| From the docstring | the example in the function's documentation |
| From the code's own check | the input that makes your code raise its own error |
| Records today's behaviour — review | what the code does today. If the code is wrong, this test is wrong too: check it |
Functions that read the clock, random numbers, files, the network or settings are listed as not tested, with the reason. Give them a parameter for that value and they can be tested.
What is supported
- Python with pytest (unittest projects too).
- TypeScript and JavaScript with Vitest.
Jest, Java, .NET, Go and mobile unit tests are not offered yet; the matrix under What Yavaren can test says so.