Skip to the content.

Adaptive Tests for TypeScript

AI‑ready testing for TypeScript. The TS package wraps the JavaScript discovery engine and adds TS niceties (TSX, path aliases).

Quick Start

npm install --save-dev @adaptive-tests/typescript typescript ts-node

Add a minimal Jest test (ts‑jest or similar):

import { getTypeScriptDiscoveryEngine } from '@adaptive-tests/typescript';

test('discovers UserService class', async () => {
  const engine = getTypeScriptDiscoveryEngine(process.cwd());
  const UserService: any = await engine.discoverTarget({ name: 'UserService', type: 'class' });
  expect(new UserService().findById(1)).toBeDefined();
});

Diagnose discovery:

npx adaptive-tests why '{"name":"UserService","type":"class"}'

Stuck? Quick fixes:

Configuration (optional)

Use the same config format as JavaScript, TS aware by default:

// adaptive-tests.config.js (or .ts)
module.exports = {
  discovery: {
    extensions: ['.ts', '.tsx', '.js'],
    cache: { enabled: true, file: '.adaptive-tests-cache.json' }
  }
};

See more: