Any contributions are welcome, encouraged, and valued. See the following information below for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for me as maintainer and smooth out the experience for all involved. The community looks forward to your contributions. 🎉✌✨
This project and everyone participating in it is governed by the project's Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to opensource@wgtechlabs.com.
There are many ways to contribute to this open source project. Any contributions are welcome and appreciated. Be sure to read the details of each section for you to start contributing.
If you can write code then create a pull request to this repo and I will review your code.
Local Development Workflow:
- Work directly on any feature branch for development and bug fixes
- No CI/CD pipeline - all validation happens locally
- Use local testing commands for quick validation before commits
Production Workflow:
- Create PR to
mainfor production releases - Local validation required before creating PR
- All quality checks must pass locally before requesting review
Important: Please ensure all tests and linting pass locally before submitting pull requests. This project is configured for local-only development workflows.
To get started with development:
-
Fork and clone the repository
git clone https://github.com/your-username/log-engine.git cd log-engine -
Install dependencies
pnpm install
-
Build the project
pnpm build
-
Run tests to verify setup
pnpm test
Note: This project uses pnpm for dependency management. Please use
pnpmfor all development tasks to ensure consistency with our package manager configuration.
Please refer to the README for more detailed setup instructions.
This section provides comprehensive information about testing the log-engine project and our two-tier testing strategy optimized for different development workflows.
We use a simplified local testing approach optimized for developer productivity:
🚀 Local Development Testing
- Fast feedback in ~3-5 seconds with
pnpm test - Quick validation without coverage generation using
pnpm test -- --silent - Optimized for iteration speed and developer productivity
🛡️ Comprehensive Local Testing
- Full coverage reporting with
pnpm test:coverage - Security validation with
pnpm secure(requires Snyk account) - Complete validation with
pnpm validatebefore creating PRs
# Install dependencies
pnpm install
# 🚀 Fast local testing (recommended for development)
pnpm test
# 🛡️ Full testing with coverage (before creating PRs)
pnpm test:coverage
# 📊 Coverage only
pnpm test:coverage
# 👀 Watch mode for development
pnpm test:watch
# 🐛 Debug test issues
pnpm test:debug| Command | Speed | Coverage | Use Case |
|---|---|---|---|
test |
⚡⚡⚡⚡⚡ | ❌ | Quick validation, daily development |
test:coverage |
⚡⚡⚡ | ✅ | Pre-PR testing, quality assurance |
test:debug |
⚡⚡ | ❌ | Troubleshooting hanging tests |
test:watch |
⚡⚡⚡⚡ | ❌ | Live development, TDD workflow |
For Feature Development:
- Work on feature branch from
main - Use
pnpm testfor quick validation during development - Use
pnpm lintto check code quality - Commit changes with descriptive messages
- Iterate quickly with fast local feedback
For Production Release:
- Run full validation:
pnpm validate(lint + test + build + size check) - Ensure coverage requirements are met with
pnpm test:coverage - Run security checks:
pnpm secure(if Snyk is configured) - Create PR to
mainfor review
- Location: Tests are in
src/__tests__/organized by component - Utilities: Async test utilities in
async-test-utils.tsfor reliable file/HTTP testing - Isolation: Each test uses unique directories to prevent conflicts
- Cleanup: Automated cleanup with timeout protection
- CI Optimization: Different configs for local vs CI environments
The project uses a clean testing approach that suppresses noisy console output:
- Global Setup:
jest.setup.jsautomatically mocksconsole.errorduring tests to prevent confusing output - Production Code: Error logging works normally in production - suppression only applies to test environments
- Test Isolation: Each test maintains proper error logging behavior while keeping console output clean
- CI/CD: Clean test output in continuous integration environments without affecting production logging
This approach ensures that test logs remain readable while preserving all error logging functionality in production code.
Local Development:
- Write your tests alongside feature development
- Run
pnpm testfor quick validation (~3-5 seconds) - Ensure tests follow established patterns and are isolated
- Use
pnpm test:watchfor live development feedback
Pre-Pull Request:
- Run full test suite:
pnpm test:coverage - Verify coverage requirements are met (should be 80%+)
- Test across different scenarios and edge cases
- Run linting:
pnpm lint - Run full validation:
pnpm validate
Pull Request Checklist:
- All tests pass with
pnpm test - Coverage requirements met with
pnpm test:coverage - New functionality has corresponding tests
- Edge cases and error scenarios are covered
- Test names are descriptive and follow conventions
- No test pollution (tests are properly isolated)
- Tests complete quickly (no arbitrary timeouts)
- Code quality checks pass with
pnpm lint
✅ Do:
- Use
async/awaitfor asynchronous operations - Utilize
waitForFile(),waitForFileContent()fromasync-test-utils.ts - Create unique test directories to prevent conflicts
- Write descriptive test names
- Test both success and failure scenarios
❌ Don't:
- Use arbitrary
setTimeout()calls - Use
donecallbacks (prefer async/await) - Create tests that depend on other tests
- Use fixed file paths that might conflict
- Write tests that take longer than necessary
If tests are hanging:
pnpm test:ci:debug # Shows open handles and verbose outputIf tests are flaky:
- Check for shared resources (files, directories)
- Ensure proper cleanup in
afterEach/afterAll - Use unique identifiers for test artifacts
Thank you for contributing to the log-engine test suite! 🧪
Improvements to documentation are always welcome! This includes:
- README updates
- Code comments
- Examples and usage guides
- Fixing typos or clarifying existing documentation
For any security bugs or issues, please read the security policy. For other bugs, please create an issue using the bug report template.
This project is intentionally configured for local-only development workflows to keep the setup simple and accessible:
- 🚀 Faster iteration: No waiting for CI/CD pipelines
- 🛠️ Simpler setup: No complex CI configurations to maintain
- 💰 Cost-effective: No CI/CD resource costs
- 🔧 Developer control: Full control over testing and validation
- 📦 Lightweight: Focus on code quality, not infrastructure
Quality is maintained through:
- Comprehensive local testing with 95%+ coverage
- Security scanning via Snyk integration
- TypeScript strict mode for type safety
- ESLint with security rules for code quality
- Pre-commit validation via
pnpm validate - Manual review process for all contributions
💻 with ❤️ by Waren Gonzaga, WG Technology Labs, and Him 🙏