Test utilities and builders for Lichtblick projects.
npm install --save-dev @lichtblick/test-builders
# or
yarn add -D @lichtblick/test-buildersimport { BasicBuilder } from "@lichtblick/test-builders";
// Generate random test data
const randomString = BasicBuilder.string({ length: 10 });
const randomNumber = BasicBuilder.number({ min: 1, max: 100 });
const randomDateTime = BasicBuilder.datetime();
const randomDate = BasicBuilder.date();
const randomBoolean = BasicBuilder.boolean();
const randomFloat = BasicBuilder.float(1, 100);
const randomBigInt = BasicBuilder.bigInt(BigInt(1), BigInt(100));
const randomArray = BasicBuilder.multiple(() => BasicBuilder.string(), 5);
const randomSample = BasicBuilder.sample(["option1", "option2", "option3"]);
const randomMap = BasicBuilder.genericMap(() => BasicBuilder.number());
const randomDict = BasicBuilder.genericDictionary(() => BasicBuilder.boolean());BasicBuilder- Basic data types (strings, numbers, dates, booleans, maps, arrays, etc.)datetime()- Generate random datetime strings (ISO 8601 format)date()- Generate random Date objectsboolean()- Generate random booleansnumber()- Generate random integers with configurable min/maxfloat()- Generate random floats with configurable min/maxbigInt()- Generate random bigints with configurable min/maxstring()- Generate random strings with configurable length, charset, and capitalizationstringMap()- Generate random Map<string, string> with configurable count and key/value optionsgenericMap()- Generate random Map<string, T> with custom value generatorgenericDictionary()- Generate random Record<string, T> with custom value generatormultiple()- Generate arrays of random values using a factory functionnumbers()- Generate arrays of random numbersstrings()- Generate arrays of random strings with configurable optionssample()- Pick random sample(s) from array or object
Merge partial props with fallback props.
Helper function to call private methods for testing purposes.
This project follows Git Flow branching strategy:
main- Production releasesdevelop- Integration branchfeature/*- New featuresrelease/*- Release preparationhotfix/*- Production hotfixes
See Git Flow Guide for details.
# Development
yarn build # Build the package
yarn test # Run tests
yarn lint # Lint and fix
yarn format # Format code
yarn validate # Run all checks- ✅ Automated testing on push
- 📦 Auto-publish to NPM on release
- 🔄 Auto-merge main → develop
- 📊 Code coverage reporting
Create releases via GitHub Actions UI or scripts. See Git Flow Guide.
- Fork the repository
- Create feature branch:
git checkout -b feature/my-feature develop - Commit:
git commit -m "feat: add feature" - Push:
git push origin feature/my-feature - Open PR to
develop
MPL-2.0 - Copyright (C) 2023-2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)