Write tests for channels.js