Problem
The project currently has no unit tests or automated testing suite to verify correctness, filter behaviors, or regression safety of OneEuroFilter.
Proposed Solution
We need to set up a modern, lightweight testing suite (e.g. using Vitest, Jest, or another library that supports TypeScript out-of-the-box).
The test suite should verify:
- Initial state filtering: Verifying \initialized === false\ path returning a copy of the input.
- Filtering correctness: Verifying math formulas and exponential smoothing outputs over multiple samples.
- Dynamic resizing behaviors: Verifying safety when passing vectors of length 3, then resizing to 5.
- Boundary conditions and safeguards:
- Zero and negative delta time (\ e <= 0) to verify they don't propagate \NaN.
- \Float32Array\ and \Float64Array\ type preservation.
- Performance/Allocation: Verifying the zero-allocation path with the \out\ parameter works correctly.
CI Integration
Set up a GitHub Actions workflow to run the unit test suite automatically on every push to main and all incoming pull requests.
Build System Upgrade
Consider migrating the build/bundling system from Webpack to Vite (which uses Rollup for library builds) for a faster and unified development/build setup since we are using Vitest.
Task List
Problem
The project currently has no unit tests or automated testing suite to verify correctness, filter behaviors, or regression safety of OneEuroFilter.
Proposed Solution
We need to set up a modern, lightweight testing suite (e.g. using Vitest, Jest, or another library that supports TypeScript out-of-the-box).
The test suite should verify:
CI Integration
Set up a GitHub Actions workflow to run the unit test suite automatically on every push to main and all incoming pull requests.
Build System Upgrade
Consider migrating the build/bundling system from Webpack to Vite (which uses Rollup for library builds) for a faster and unified development/build setup since we are using Vitest.
Task List
npm run test)