Skip to content

Closes #299 #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2017
Merged

Closes #299 #301

merged 3 commits into from
Sep 17, 2017

Conversation

xbony2
Copy link
Contributor

@xbony2 xbony2 commented Sep 17, 2017

(With help from @ekmartin :P I cannot JavaScript)

@coveralls
Copy link

coveralls commented Sep 17, 2017

Coverage Status

Coverage remained the same at 99.254% when pulling 5c927a5 on xbony2:patch-1 into 345da09 on reactiflux:master.

@ekmartin
Copy link
Member

Thanks! Do you want to try to add a test for it too? It should probably look something like this: https://github.com/xbony2/discord-irc/blob/5c927a5e1080d73e5fa7de075b436010bc704573/test/bot.test.js#L461-L481

  it('should support multi-character command prefixes', function () {
    const bot = new Bot({ ...config, commandCharacters: ['@@'] });
    const text = '@@test command';
    const message = {
      content: text,
      mentions: { users: [] },
      channel: {
        name: 'discord'
      },
      author: {
        username: 'test',
        id: 'not bot id'
      },
      guild: this.guild
    };

    this.bot.sendToIRC(message);
    ClientStub.prototype.say.getCall(0).args.should.deep.equal([
      '#irc', 'Command sent from Discord by test:'
    ]);
    ClientStub.prototype.say.getCall(1).args.should.deep.equal(['#irc', text]);
  });

@ekmartin
Copy link
Member

After modifying bot.test.js you can run the tests with npm test.

(accidentally pushed to wrong branch there but let's hope no one notices)
@Throne3d
Copy link
Collaborator

@xbony2 It looks like you need to remove the trailing spaces on line 810 (here) and also use bot not this.bot where the test has this.bot.sendToIRC(message); on line 827 (here) for the linter to pass. If you can, you might want to run npm test locally before pushing it to check that it works after that? (The continuous integration tool shows this here.)

Thanks!

@coveralls
Copy link

coveralls commented Sep 17, 2017

Coverage Status

Coverage remained the same at 99.254% when pulling 591b4f6 on xbony2:patch-1 into 345da09 on reactiflux:master.

@xbony2
Copy link
Contributor Author

xbony2 commented Sep 17, 2017

@Throne3d yeah, npm pointed it out to me. Thanks. npm test gives a happy-looking result so unless anyone has any complaints this should be good to go ^_^

@ekmartin ekmartin merged commit c0a4133 into reactiflux:master Sep 17, 2017
@xbony2 xbony2 deleted the patch-1 branch September 17, 2017 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants