mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
bb43dc5beb
Implement a flexible snapshot-based testing framework for oxc_formatter using `insta` and build-time test generation. ## Features - **Auto-discovery**: Tests are automatically discovered from `tests/fixtures/` directory - **Individual test functions**: Each fixture file gets its own test function for easy identification - **Hierarchical options**: Support for `options.json` files at any directory level - **Multiple option sets**: Test the same input with multiple formatting configurations - **Co-located snapshots**: Snapshot files are stored next to test files (e.g., `foo.js.snap`) - **Comprehensive README**: Detailed documentation for adding and running tests ## Implementation - **build.rs**: Scans `tests/fixtures/` and generates test functions at build time - **tests/fixtures/mod.rs**: Core test infrastructure with option resolution and snapshot generation - **tests/README.md**: Complete guide for using the test framework - **Sample tests**: Example tests demonstrating JS, JSX, TS, and nested configurations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3 lines
32 B
Rust
3 lines
32 B
Rust
mod fixtures;
|
|
mod ir_transform;
|