8 GB on an M1 or M2 is not the same as 8 GB on an Intel-based device; the memory bandwidth is significantly higher. A 2x factor (Apple Silicon 8/16 GB vs Intel 16/32) seems about right.
Overall I would still prefer an Apple Silicon Mac especially if it's just for testing purposes. It's not like one Electron app will require constant swapping. An M1 Mac mini with 8 GB of RAM is perfectly fine for that.