updating setImmediate back to global.setImmediate coz istanbul gives ReferenceError for node8