You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
792 B

  1. const assert = require('assert');
  2. const Channel = require("../src/channel.js");
  3. describe('Channel', function () {
  4. describe('#contructor()', function () {
  5. it("should create a channel", function () {
  6. const channel = new Channel("#testchan")
  7. assert.equal(typeof channel, 'object')
  8. })
  9. })
  10. describe('#join(user)', function () {
  11. it("should add the user to a channel and send a JOIN command to the user", function (done) {
  12. const channel = new Channel("#testchan")
  13. let mockedUser = {nickname: "some_nick"}
  14. mockedUser.sendRaw = function(data) {
  15. assert.equal(data, ":some_nick JOIN #testchan")
  16. done()
  17. }
  18. channel.join(mockedUser)
  19. })
  20. })
  21. })