refactor(core): Reduce boilterplate code in between tests also cleaned up some imports, and fixed the tests in node.js 20
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>