Skip to content

v6.0.0

Choose a tag to compare

@jterrazz jterrazz released this 13 Apr 21:52
· 37 commits to main since this release
53e6f32

⚠ BREAKING CHANGES

New spec() API replaces integration()/e2e()/cli()

// Before
import { integration, e2e, cli, postgres, grep } from '@jterrazz/test';
const s = await integration({ app: () => myApp, services: [db] });
const s = await e2e({ root: '../../' });
const s = await cli({ command: 'my-cli' });
grep(result.stdout, 'pattern');

// After
import { spec, app, stack, command } from '@jterrazz/test';
import { postgres } from '@jterrazz/test/services';
const s = await spec(app(() => myApp), { services: [db] });
const s = await spec(stack('../../'));
const s = await spec(command('my-cli'));
result.grep('pattern');

Subpath exports

  • @jterrazz/test — core API (spec, app, stack, command)
  • @jterrazz/test/services — postgres, redis
  • @jterrazz/test/mock — mockOf, mockOfDate

Parallel test execution via IsolationStrategy

  • app() mode: Postgres schema-per-worker + Redis DB-per-worker
  • stack() mode: per-worker compose project (-p test-worker-N)
  • command() mode: already isolated (temp dirs)
  • 44% faster full test suite (19s vs 34s)

Other changes

  • result.grep(pattern) replaces standalone grep(result.stdout, pattern)
  • runner.docker(id) replaces standalone dockerContainer(id)
  • Tests restructured: tests/http/, tests/cli/, tests/adapters/
  • Old API kept as legacy aliases for backward compatibility