TestyTesterson
raw JSON → 9001.9001.9020 verified Sat Apr 25 auth: no javascript
A module to generate ridiculous test data, version 9001.9001.9020. Regularly released, it provides random usernames, names, emails, lorem ipsum text, image URLs, birthdays, countries, and IP addresses. Differentiated by its intentionally nonsensical and humorous output, suitable for mocking data in development and testing environments where realism is not required.
Common errors
error ERR_REQUIRE_ESM: require() of ES Module not supported ↓
cause Using require() on an ESM-only module.
fix
Use import statement: import testercle from 'testytesterson'
error TypeError: testercle.username is not a function ↓
cause Forgetting to call the method with parentheses.
fix
Use testercle.username() instead of testercle.username
Warnings
breaking ESM-only since v9001.9001.9000; require() fails with ERR_REQUIRE_ESM ↓
fix Use import instead of require.
gotcha imageUrl() returns 'https://api.adorable.io/avatars/200/...' which is now a dead service. ↓
fix The image URL API may return 404; consider using a different placeholder service.
gotcha Output is intentionally ridiculous and non-deterministic; cannot be used for reproducible test data. ↓
fix Use a deterministic fake data library if reproducibility is needed.
Install
npm install testytesterson yarn add testytesterson pnpm add testytesterson Imports
- default wrong
const testercle = require('testytesterson')correctimport testercle from 'testytesterson' - username wrong
testercle.usernamecorrecttestercle.username() - imageUrl wrong
testercle.imageUrlcorrecttestercle.imageUrl()
Quickstart
import testercle from 'testytesterson';
console.log(testercle.username()); // curtis frejaboing
console.log(testercle.name()); // Huge Spotsausage
console.log(testercle.email()); // mazingknife@jean-luc.com
console.log(testercle.lorem());
console.log(testercle.imageUrl()); // https://api.adorable.io/avatars/200/vastbritchesdrug.png
console.log(testercle.birthdayISO());
console.log(testercle.country()); // BE
console.log(testercle.ip()); // 149.33.8.251