Skip to content

Commit 483fc44

Browse files
doppins-botekmartin
authored andcommitted
[Doppins] Upgrade dependency eslint to ^4.1.1 (#254)
* Upgrade dependency eslint to ^4.0.0 * Upgrade dependency eslint to ^4.1.0 * Upgrade dependency eslint to ^4.1.1 * lint: run eslint --fix
1 parent 67ac5f1 commit 483fc44

File tree

4 files changed

+47
-45
lines changed

4 files changed

+47
-45
lines changed

lib/bot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ class Bot {
224224
const text = message.mentions.users.reduce((content, mention) => {
225225
const displayName = Bot.getDiscordNicknameOnServer(mention, message.guild);
226226
return content.replace(`<@${mention.id}>`, `@${displayName}`)
227-
.replace(`<@!${mention.id}>`, `@${displayName}`)
228-
.replace(`<@&${mention.id}>`, `@${displayName}`);
227+
.replace(`<@!${mention.id}>`, `@${displayName}`)
228+
.replace(`<@&${mention.id}>`, `@${displayName}`);
229229
}, message.content);
230230

231231
return text

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"babel-preset-stage-0": "^6.5.0",
5656
"chai": "^4.0.2",
5757
"coveralls": "^2.11.14",
58-
"eslint": "^3.13.1",
58+
"eslint": "^4.1.1",
5959
"eslint-config-airbnb-base": "^11.0.1",
6060
"eslint-plugin-import": "^2.2.0",
6161
"mocha": "^3.1.2",

test/bot.test.js

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ describe('Bot', function () {
2929
this.findRoleStub = sandbox.stub();
3030
this.findEmojiStub = sandbox.stub();
3131
irc.Client = ClientStub;
32-
discord.Client = createDiscordStub(this.sendMessageStub, this.findUserStub, this.findRoleStub,
33-
this.findEmojiStub);
32+
discord.Client = createDiscordStub(
33+
this.sendMessageStub, this.findUserStub, this.findRoleStub, this.findEmojiStub
34+
);
35+
3436
ClientStub.prototype.say = sandbox.stub();
3537
ClientStub.prototype.send = sandbox.stub();
3638
ClientStub.prototype.join = sandbox.stub();
@@ -80,16 +82,16 @@ describe('Bot', function () {
8082
});
8183

8284
it('should not send messages to discord if the channel isn\'t in the channel mapping',
83-
function () {
84-
this.bot.sendToDiscord('user', '#no-irc', 'message');
85-
this.sendMessageStub.should.not.have.been.called;
86-
});
85+
function () {
86+
this.bot.sendToDiscord('user', '#no-irc', 'message');
87+
this.sendMessageStub.should.not.have.been.called;
88+
});
8789

8890
it('should not send messages to discord if it isn\'t in the channel',
89-
function () {
90-
this.bot.sendToDiscord('user', '#otherirc', 'message');
91-
this.sendMessageStub.should.not.have.been.called;
92-
});
91+
function () {
92+
this.bot.sendToDiscord('user', '#otherirc', 'message');
93+
this.sendMessageStub.should.not.have.been.called;
94+
});
9395

9496
it('should send to a discord channel ID appropriately', function () {
9597
const username = 'testuser';
@@ -100,23 +102,23 @@ describe('Bot', function () {
100102
});
101103

102104
it('should not send special messages to discord if the channel isn\'t in the channel mapping',
103-
function () {
104-
this.bot.sendExactToDiscord('#no-irc', 'message');
105-
this.sendMessageStub.should.not.have.been.called;
106-
});
105+
function () {
106+
this.bot.sendExactToDiscord('#no-irc', 'message');
107+
this.sendMessageStub.should.not.have.been.called;
108+
});
107109

108110
it('should not send special messages to discord if it isn\'t in the channel',
109-
function () {
110-
this.bot.sendExactToDiscord('#otherirc', 'message');
111-
this.sendMessageStub.should.not.have.been.called;
112-
});
111+
function () {
112+
this.bot.sendExactToDiscord('#otherirc', 'message');
113+
this.sendMessageStub.should.not.have.been.called;
114+
});
113115

114116
it('should send special messages to discord',
115-
function () {
116-
this.bot.sendExactToDiscord('#irc', 'message');
117-
this.sendMessageStub.should.have.been.calledWith('message');
118-
this.debugSpy.should.have.been.calledWith('Sending special message to Discord', 'message', '#irc', '->', '#discord');
119-
});
117+
function () {
118+
this.bot.sendExactToDiscord('#irc', 'message');
119+
this.sendMessageStub.should.have.been.calledWith('message');
120+
this.debugSpy.should.have.been.calledWith('Sending special message to Discord', 'message', '#irc', '->', '#discord');
121+
});
120122

121123
it('should not color irc messages if the option is disabled', function () {
122124
const text = 'testmessage';
@@ -297,22 +299,22 @@ describe('Bot', function () {
297299
});
298300

299301
it('should not send messages to irc if the channel isn\'t in the channel mapping',
300-
function () {
301-
const guild = createGuildStub();
302-
const message = {
303-
channel: {
304-
name: 'wrongdiscord'
305-
},
306-
author: {
307-
username: 'otherauthor',
308-
id: 'not bot id'
309-
},
310-
guild
311-
};
312-
313-
this.bot.sendToIRC(message);
314-
ClientStub.prototype.say.should.not.have.been.called;
315-
});
302+
function () {
303+
const guild = createGuildStub();
304+
const message = {
305+
channel: {
306+
name: 'wrongdiscord'
307+
},
308+
author: {
309+
username: 'otherauthor',
310+
id: 'not bot id'
311+
},
312+
guild
313+
};
314+
315+
this.bot.sendToIRC(message);
316+
ClientStub.prototype.say.should.not.have.been.called;
317+
});
316318

317319
it('should parse text from discord when sending messages', function () {
318320
const text = '<#1234>';

test/formatting.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Formatting', () => {
2626

2727
it('should convert nested markdown', () => {
2828
formatFromDiscordToIRC('**bold *italics***')
29-
.should.equal('\x02bold \x16italics\x16\x02');
29+
.should.equal('\x02bold \x16italics\x16\x02');
3030
});
3131
});
3232

@@ -53,12 +53,12 @@ describe('Formatting', () => {
5353

5454
it('should convert nested IRC format', () => {
5555
formatFromIRCToDiscord('\x02bold \x16italics\x16\x02')
56-
.should.equal('**bold *italics***');
56+
.should.equal('**bold *italics***');
5757
});
5858

5959
it('should convert nested IRC format', () => {
6060
formatFromIRCToDiscord('\x02bold \x1funderline\x1f\x02')
61-
.should.equal('**bold __underline__**');
61+
.should.equal('**bold __underline__**');
6262
});
6363
});
6464
});

0 commit comments

Comments
 (0)