Experimental runner for TypeScript compiler and conformance tests:
- Docs: TypeScript-Compiler-Notes/systems/testing/baselines.md
- Tests: TypeScript/tests/baselines/reference
It was used to explore feasibility of: oxc-project/oxc#2912
Note
This project already implemented the key features but it is far from usable. See Status.
cargo run --bin test-runner /path/to/TypeScript/repo
Tested with: TypeScript#56a08250f3516b3f5bc120d6c7ab4450a9a69352
- Parse all compiler (
tests/cases/compiler) and conformance (tests/cases/conformance) tests- These are all the tests that are used to test TypeScript type checker
- A test consists of tsconfig settings and a set of source files.
- Parse error baselines
- These are used to make sure invalid code constructs and types throw errors as expected
- Parse type baselines
- These contain type annotations for every node in the AST and are used to verify types inferred by the type checker
- Parse individual files within each test with OXC
- Resolve imports using oxc_resolver with a virtual file system (only containing files defined in the test)
- Implement OXC Visitor to walk the tree in the same order as TSC
- Needs to mimic the logic of
TypeWriterWalker: src/harness/typeWriter.ts#L179
- Needs to mimic the logic of
- Assert types and errors match the baselines