Documentation

Graphtia documentation · feature

Related tests

Find test code that may provide evidence about a change.

From a code relationship to a checkable behavior

Related tests help identify test source associated with the selected entity. A test can provide a concrete example of intended behavior, but the association itself says little about assertion quality or coverage.

Use the Impact inspector

  1. Select the module or symbol being investigated.

  2. Open the Impact tab and choose “Related tests”, or use the “Show related tests” action.

  3. Open a returned test and read its setup, invocation and assertions.

  4. Run the appropriate checks in the project’s own test environment and record what they establish.

typescript
// An illustrative test, not a recorded execution result.
import { test } from 'node:test';
import { strict as assert } from 'node:assert';
import { validateOrder } from '../src/validation';

test('rejects an order with no total', () => {
  assert.throws(() => validateOrder({ id: 'order-1', total: 0 }));
});

Interpret an empty or partial result

An empty list means the current query did not return an association. It does not mean that no tests exist. Naming, test structure, unsupported semantics and view limits can affect discoverability. The product screenshot used elsewhere in these docs reports zero related tests for its selected module; it is not evidence of a successful coverage query.

A native related-tests query showing checkout.test.ts and the view’s scope notice.
The query returns checkout.test.ts as a related source candidate. The notice describes the loaded scope; this is neither a test execution result nor a coverage report.

Read the evidence behind a candidate

In the local commerce-platform example, checkout.test.ts imports checkout and validateOrder. Explorer returns that test module when investigating validation. The engine distinguishes compiler test metadata or explicit test relationships from heuristic candidates reached through dependency paths and conventional test-file names.

This fixture is a static-source example. Its exported checks were not executed by the graph query, and the function name alone is not a passing result. Read the assertion, run the relevant runner in the actual project, and keep its observed result separate from the relationship.

typescript
// tests/checkout.test.ts — source inspected by the graph
import { checkout } from '../src/checkout-service';

export function checkoutCreatesPaidOrder() {
  const order = checkout('order-1042');
  if (order.status !== 'paid') throw new Error('Expected a paid order');
}
// Finding this function does not execute it.

Graphtia

This page is on its way. Join the waitlist to hear what’s next for Graphtia.

Join waitlist