Skip to content
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

Fix tests #201

Merged
merged 2 commits into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"main": "index.js",
"scripts": {
"eslint": "eslint .",
"test": "nyc mocha"
"test": "nyc mocha --exit"
},
"nyc": {
"temp-directory": "./coverage/.nyc_output",
Expand Down
4 changes: 2 additions & 2 deletions test/test-formatdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ describe('SparkFormatter', function() {
var msg = {
message: {
user: {
room: "SparkRoomName",
roomId: "SparkRoomId",
name: "SparkUserName"
}
}
Expand All @@ -404,7 +404,7 @@ describe('SparkFormatter', function() {
expect(o.name).to.be.an('string');
expect(o.name).to.equal('SparkUserName');
expect(o.room).to.be.an('string');
expect(o.room).to.equal('SparkRoomName');
expect(o.room).to.equal('SparkRoomId');
});
});

Expand Down
19 changes: 14 additions & 5 deletions test/test-postdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,9 @@ describe("spark post data", function() {
expect(robot.messageRoom).to.have.been.calledOnce;
expect(robot.messageRoom).to.have.been.calledWith(
{
channel: input.channel,
id: input.channel,
roomId: input.channel,
name: input.user,
extra: undefined
},
user + "normal boring text"
Expand All @@ -912,6 +914,7 @@ describe("spark post data", function() {
it('should post to room and not mention a user', function() {
robot.messageRoom = sinon.spy();
var input = {
user: 'stanley',
channel: '#stackstorm',
message: "normal boring text",
whisper: false
Expand All @@ -922,10 +925,12 @@ describe("spark post data", function() {
expect(robot.messageRoom).to.have.been.calledOnce;
expect(robot.messageRoom).to.have.been.calledWith(
{
channel: input.channel,
id: input.channel,
roomId: input.channel,
name: input.user,
extra: undefined
},
"normal boring text"
"stanley: normal boring text"
);
});

Expand All @@ -947,7 +952,9 @@ describe("spark post data", function() {
expect(robot.messageRoom).to.have.been.calledOnce;
expect(robot.messageRoom).to.have.been.calledWith(
{
channel: input.channel,
id: input.channel,
roomId: input.channel,
name: input.user,
extra: {
custom1: "attribute1",
custom2: "attribute2"
Expand Down Expand Up @@ -992,7 +999,9 @@ describe("spark post data", function() {
expect(robot.messageRoom).to.have.been.calledOnce;
expect(robot.messageRoom).to.have.been.calledWith(
{
channel: input.channel,
id: input.channel,
roomId: input.channel,
name: input.user,
extra: undefined
},
user + "NORMAL PRETEXT\nnormal boring text"
Expand Down