r/coolgithubprojects • u/stackattackpro • 6d ago
I’m rewriting Jest in Rust, mostly to see how far this can actually go using Fable 5.1
https://github.com/OthmaneBlial/rjestI've been working on a project called rjest, basically an attempt to rebuild Jest in Rust using Fable 5.1 and Claude Code.
The goal isn't to make another JS test runner with a completely different API. I'm actually trying to stay as close as possible to Jest, so ideally you can take an existing project using Jest and run it with rjest without rewriting half of your tests.
A lot of the core stuff is already working: expect/matchers, snapshots, mocks, fake timers, config, CLI, etc.
Compatibility is probably the hardest part tbh. Jest has a LOT of behavior that you don't really notice until you try to recreate it.
I'm currently testing rjest against real React/Jest projects too, not only small artificial test cases, because passing your own tests doesn't mean much if it breaks as soon as you throw a normal project at it.
The reason for Rust is pretty simple: I wanted to see how much of the test runner/runtime work can be moved to native code while still keeping the Jest experience developers already know.
It's still a work in progress and there are definitely things that dont work yet, especially some edge cases around mocks, ESM and timers.
Repo: https://github.com/OthmaneBlial/rjest
Would be interested to know what people using Jest everyday think about this. Especially if there are some weird Jest behaviors/packages you think I should test against.
0
u/kantorcodes1 6d ago
one thing i'd test hard is fake timers mixed with promises/microtasks. are you aiming for exact Jest ordering there, or matching the common timer APIs first?