Jarroba Tools · Test audit

v0.3.2
io.github.Invarato/jarroba-tools-tests Checked 1 day ago Published 8 days ago

Audits tests instead of writing them: what each one really asserts.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

test_audit

Audit a test file and say, case by case, what it ACTUALLY checks: which ones assert about a value, which only check that something exists, which assert nothing at all, and which are disabled. Returns the EVIDENCE behind each verdict (the assertions it found) so you can check the checker. TypeScript, JavaScript, Python, Java and Go. Executes nothing. Run it on the tests you just wrote, BEFORE you hand them over: told to "make the tests pass", widening a matcher is cheaper than fixing the bug, and this is what notices.

ParameterTypeDescription
dialectsarrayYour own assertion helpers. If your team has a home-made expect(), declare it here and it will stop coming back as "indeterminate".
languagestringRequired if you pass `text` without `path`.
pathstringPath to the test file. The language is inferred from the extension.
textstringThe test file as text. Alternative to `path`.

test_diff_audit

Compare TWO versions of the same test file and say whether the change STRENGTHENED or WEAKENED the safety net: widened matchers (toBe -> toContain -> toBeGreaterThan), assertions that disappeared, and cases that stopped running. Call it on your own work after touching tests, and above all after fixing a red suite: reaching green by softening an assertion is cheaper than fixing the bug, and this is what catches it. Executes nothing.

ParameterTypeDescription
afterstringNew version, as text.
afterPathstringPath to the new version.
beforestringPrevious version, as text.
beforePathstringPath to the previous version (e.g. what `git show HEAD:file` produced).
languagestringRequired if you pass the texts without paths.

test_cases

From a TYPE to the cases worth testing, with no model involved: equivalence partitions and boundary values derived from a TypeScript signature or a JSON Schema. For each parameter it returns the TECHNIQUE that applies and why — boundary values only mean something where there is an ordering, so they are NOT applied to a boolean or an enum. It adds the properties that can be asserted without knowing the domain, plus a fast-check test ready to paste. Use it BEFORE writing the tests, so you do not miss the cases everyone misses.

ParameterTypeDescription
namestringFunction name for the generated code. Inferred from the signature if you pass one.
schemastringJSON Schema (an object with `properties`). Alternative to `signature`.
signaturestringTypeScript signature, e.g. function calculate(price: number, kind: 'A' | 'B'): number

test_debt

A project's DISABLED-test debt, WITH ITS AGE. Walks the folder, finds every `it.skip`, `xit`, `@Ignore`, `@pytest.mark.skip` or `t.Skip`, and dates it with `git blame`. None of those cases appears in a coverage report, because as far as the runner is concerned they do not exist: this is the debt nobody measures and the one that lasts longest — disabled 'to fix later', and later never comes. Sorted oldest first, which is what makes it actionable.

ParameterTypeDescription
folder *stringRoot of the project (or subtree) to review.
maxFilesintegerCap on how many test files to read.