Skip to content

valeneiko/type-runner

Repository files navigation

TypeScript test runner

Experimental runner for TypeScript compiler and conformance tests:

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.

How to run this?

cargo run --bin test-runner /path/to/TypeScript/repo

demo Tested with: TypeScript#56a08250f3516b3f5bc120d6c7ab4450a9a69352

Status

  • 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
  • Assert types and errors match the baselines

About

Experimental runner for TypeScript compiler and conformance tests

Resources

License

Stars

Watchers

Forks