exchange.js & associated test