Skip to main content
Data-driven testing (dataset fan-out) is a good fit when many test cases share the same structure and only the inputs change. Typical examples are SQL generation, intent classification, retrieval QA, and tool selection.

How fan-out works

When there is no external business ID, a .eval.ts file exports an array by default:

Generated IDs

If the file is evals/sql.eval.ts, the generated IDs are:
The numeric suffix is zero-padded so IDs stay stable and easy to filter. When the data source already carries a stable case, issue, or benchmark ID, export a keyed record by default instead:
If the file is evals/swelancer.eval.ts and the key is 15193, the ID is swelancer/15193. A key must be a non-empty path segment: it cannot be . or .., and it cannot contain /, \, or control characters. NiceEval discovers cases in key lexicographic order, so a change in the data source’s return order never changes run order.

Loading from YAML and JSON

loadYaml and loadJson require a decoder. The unvalidated dynamic value exists only at the decoder input; after validation, the return value is strongly typed data that the Eval can use directly.

Filtering dataset evals

Datasets vs separate files

The cases have exactly the same structure. Only the input and expected output change.
Datasets are good for broad horizontal coverage. Separate eval files are better when the behavior itself is complex.