Make fixtures repeatable and clearly synthetic
A useful mock dataset should reproduce a bug without importing a real person’s information.
Start with a deterministic seed
The mock generator hashes your seed and feeds a noncryptographic Mulberry32 sequence. The same preset, field list, locale, count and seed reproduce the same values. That makes a failing test or screenshot easier to share and investigate.
This algorithm belongs only to fixtures. A predictable sequence is unacceptable for API keys or authentication tokens. The secret generator uses an independent Web Crypto path with no seed option.
Choose the right export shape
JSON exports a single array, suitable for direct parsing as one document. NDJSON writes one JSON object per line, useful for line-oriented processing and streaming test fixtures. CSV exports a header row and quoted cells.
Spreadsheet applications may interpret cells beginning with =, +, - or @ as formulas. This exporter prefixes potentially active cells with an apostrophe and quotes the result, including cells with leading control characters. Spreadsheet behavior varies, so import external CSV as data rather than enabling active content.
JSON: [{"id":"user_1"},{"id":"user_2"}]
NDJSON: {"id":"user_1"}
{"id":"user_2"}
CSV: "id"
"user_1"Keep the fixture honest
Names say Sample Person, emails use reserved example.com and places are labeled Example City or Example Borough. The records do not represent real people. Locale changes are intentionally modest; this is not a full international address or localization system.
Products, orders and events are independent simple fixtures. Order totals are not calculated from a product catalog and quantities, so do not use the output to test accounting identities. Extend your own domain fixture when relational consistency is the behavior under test.
Create repeatable synthetic API fixtures
Use the same seed and selected fields to reproduce a two-record fixture for a test suite.
Input
{
"preset": "users",
"count": 2,
"seed": "securedevtools-demo",
"locale": "en-US",
"fields": [
"id",
"name",
"email"
]
}Expected output
[
{
"id": "user_1",
"name": "Sample Person 45623",
"email": "[email protected]"
},
{
"id": "user_2",
"name": "Sample Person 32873",
"email": "[email protected]"
}
]Names are visibly synthetic and email addresses use the reserved example.com domain. Reusing the seed and settings reproduces the same data. This generator’s deterministic PRNG is for fixtures, not secrets; CSV export separately neutralizes leading spreadsheet formula characters.
Keep the references close
Primary documentation supports the technical details above. Check it alongside the behavior of your own runtime and deployment.
Open Mock API data →