DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.33k stars 28 forks source link

Self-test #1292

Closed edemaine closed 5 days ago

edemaine commented 1 week ago

Implementing https://github.com/DanielXMoore/Civet/pull/1263#issuecomment-2127573885 :

I wonder about adding another test mode that runs yarn test but where it uses the current code to build itself (after building itself with the current release). Essentially yarn build + yarn test using the current build instead of NPM. I wouldn't run this all the time, probably, but it would be especially good for CI testing to avoid surprises like this in the future. Civet is of course the largest example of Civet code, so it's a good real-world test.

I came across this again in https://effectivetypescript.com/2024/04/16/inferring-a-type-predicate/ (text and video), which calls this TypeScript's "self-check", so I've adopted the "self-test" terminology here.

While implementing this, I found a bug where a line of source/parser/util.civet wouldn't parse. So even more evidence that this is an important test to have! I fixed that bug too.