commands_test.js (920B)
1 import chai from 'chai'; 2 import chaiAsPromised from 'chai-as-promised'; 3 import Login from '../lib/login'; 4 import Commands from '../lib/commands'; 5 6 chai.use(chaiAsPromised); 7 8 chai.should(); 9 10 describe('Commands', () => { 11 const mx = new Login; 12 const room = {roomId: '!EDuQpgunAOTYiUKIcU:matrix.org'}; 13 mx.getClient().then(client => { 14 client.sendTextMessage(room.roomId, "Test messages are incoming!\n").catch(error => console.log(error)); 15 it('should send help', done => { 16 const CommandHandler = new Commands(client); 17 const help = CommandHandler.help(room); 18 help.should.be.fulfilled.and.notify(done); 19 }); 20 it('should send languages', done => { 21 const CommandHandler = new Commands(client); 22 const languages = CommandHandler.languages(room); 23 languages.should.be.fulfilled.and.notify(done); 24 }); 25 }); 26 });