Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Patch jest to not use JSON serialization in message passing (#…
…5883) We often get "Do not know how to serialize a BigInt" as an output from our failing tests (see [here](https://github.com/AztecProtocol/aztec-packages/actions/runs/8756999966/job/24035011971#step:5:465) for an example). This is caused by jest using node `child_process` to spawn multiple runners, and using json serialization for message passing, so when a child wants to report a failure in a test, if that failure involved a bigint, it triggers this error. One solution is to migrate to jest's experimental worker threads, but I'm not sure how memory is handled if we move from subprocesses to threads. This solution is dirtier but allows us to keep using child processes: it patches jest so it uses node's [advanced serialization](https://nodejs.org/api/child_process.html#advanced-serialization) which "is generally more powerful and supports more built-in JavaScript object types, such as BigInt, Map and Set, ArrayBuffer and TypedArray, Buffer, Error, RegExp etc". I tested it on the same PR as I linked above and indeed we can now see [failed bigint expectations](https://github.com/AztecProtocol/aztec-packages/actions/runs/8757912954/job/24037750048#step:5:739) as error messages.
- Loading branch information