This commit allows tests in the test runner to mock functions and methods. PR-URL: https://github.com/nodejs/node/pull/45326 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>