# Pastebin 3sDGWadg const map = require('async/map') let clients = {} before(function (done) { fc = new FactoryClient() const keys = ['a', 'b'] map(keys, (cb) => { fc.spawnNode(cb) }, (err, nodes) = { if (err) return done(err) keys.forEach((key, i) => { clients[key] = nodes[i] }) done() }) })