Rich-Harris / dts-buddy

WORK IN PROGRESS DO NOT USE
MIT License
317 stars 12 forks source link

feat: typescript as peer #58

Closed dominikg closed 1 year ago

dominikg commented 1 year ago

tests fail for ts 5.1 and 5.2, i'm a bit at a loss for why exactly.

One fail is because an expected const is now a let which i think is more correct as the original const got turned into a namespace and the number should be mutable.

The other one has to do with declaration tracking.

Added a test matrix to ensure we test the whole peer range, not bothering with ts 4.x anymore and stopping at released versions. With every new 5.x release we can extend the peer range after testing. The alternative would be to just use ^5 on the peer and just hope that new minors don't break stuff like 5.0 -> 5.1 appearantly did

Rich-Harris commented 1 year ago

Fixed the declaration tracking thing, it was testing for a magic number (16) instead of ts.NodeFlags.Namespace.

For the differing test output I added a mechanism for creating per-version expected output files. Hopefully it won't need to be used often.