refactor: use vitest for tests
- Swaps out custom test utilities for Vitest typechecking.
- Adds GitHub Action workflow for test, build, typecheck
- Deps: Adds Vitest, removes Jest, switches to pnpm (happy to switch back to npm, just lmk)
@gvergnaud let me know if you want to head in this direction and I can resolve the conflicts.
If not, feel free to close this PR so it doesn’t grow too stale and I can stop watching it.
I see you use assertType<X>(Y) to assert the type, any particular reason?
assertType is ok for checking value type, but not great to compare 2 types
for example you can do something like this

and it will not error
because as for value, all we care is whether we can assign it to something(to variable, argument, property etc)
which mean as long as the value type is sub type of the required type, then it is ok. It doesnt need to be exactly the same type
which is why assertType<number>(2 as const) does not trigger any error, because 2 is a sub type of number
But type level programming is about creating all kind of utility types, we need to make sure the output are exactly the same type as the expected type, so it is better to use type equality check here
I also saw you use expectTypeOf<X>().toEqualTypeOf<Y>(), this is correct because this is type equality check, just a bit lengthy
or is there anything I don't know about?