🧪

@iklab/testkit

Open-Source Test Utilities for Developers

Four practical utilities for anyone who writes tests. ISTQB test data, flakiness prediction, test.each formatting, duplicate detection. Zero dependencies, TypeScript-first.

v1.0.0 Zero dependencies TypeScript ESM + CJS Node 18+

MIT License. Free forever.

Installation

npm install @iklab/testkit

Four Utilities

Each solves one problem. Import what you need.

1

boundaries()

ISTQB test data generation. Boundary Value Analysis and Equivalence Partitioning for 10 field types.

numberstringemaildatebooleanenumurlpasswordphoneuuid
import { boundaries } from '@iklab/testkit';

const result = boundaries({
  type: 'number',
  min: 1,
  max: 100,
});
// result.valid   → [1, 2, 50, 99, 100]
// result.invalid → [0, 101, NaN, -Infinity]
2

flaky()

Predict flakiness risk before automation. 11 risk patterns with weighted scoring 1-10.

timingexternal servicesconcurrencybrowser statedate/timenetworkfile I/Orandomnessglobal stateanimationretry logic
import { flaky } from '@iklab/testkit';

const result = flaky(
  'Wait 3 seconds then check API response'
);
// result.score    → 7
// result.risks    → ['hardcoded wait/sleep/delay']
// result.patterns → [{ name: 'timing', ... }]
3

testEach()

Transform boundary results into ready-made test.each arrays for Jest and Vitest.

import { boundaries, testEach } from '@iklab/testkit';

const rows = testEach(boundaries({
  type: 'number', min: 0, max: 255,
}));
// rows → [
//   ['min boundary (0)', 0, true],
//   ['below min (-1)', -1, false],
//   ...
// ]

test.each(rows)('%s: %s', (label, value, expected) => {
  expect(isValid(value)).toBe(expected);
});
4

detectDuplicates()

Find duplicate test descriptions using Jaccard similarity on word tokens.

import { detectDuplicates } from '@iklab/testkit';

const result = detectDuplicates([
  'Verify user can log in with valid credentials',
  'Check user login with correct password',
  'Verify search returns results',
]);
// result.pairs → [{
//   indexA: 0, indexB: 1,
//   similarity: 0.36,
//   descriptionA: 'Verify user can log in...',
//   descriptionB: 'Check user login with...',
// }]

Why @iklab/testkit

ISTQB-grounded test data, not random values. Boundary Value Analysis and Equivalence Partitioning built in.
Predict flaky tests before writing automation. 11 risk patterns from real-world CI/CD pipelines.
Zero dependencies. 9.4 KB packed. Works with Jest, Vitest, Playwright, any test framework.
Full TypeScript support with exported types. ESM and CommonJS dual output.

Start using testkit

Install from npm. MIT licensed. Contributions welcome.