Repository navigation
Expand file tree
/
Copy pathtests.js
More file actions
53 lines (40 loc) · 1.69 KB
/
Copy pathtests.js
File metadata and controls
53 lines (40 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require('mocha');
require('should');
var github = require('./github');
var jira = require('./jira');
var teamcity = require('./teamcity');
var fs = require('fs');
describe('JustSayin',function(){
describe('github',function(){
it('should parse a github post body into a hipchat html message',function(done){
var sampleJSON = JSON.parse(fs.readFileSync('Samples/github_sample.json'));
var sampleHTML = fs.readFileSync('Samples/githubtohipchat.html').toString();
var result = github.parseGithubJsonIntoHipChatMessageHtml(sampleJSON);
result.should.eql(sampleHTML);
done();
})
})
describe('jira',function(){
it('should parse a jira post body into a status update html message', function(done){
var sampleJSON = JSON.parse(fs.readFileSync('Samples/jira_sample.json'));
var sampleHTML = fs.readFileSync('Samples/jiratohipchat.html').toString();
var result = jira.parseJiraPostBodyToHtmlMessage(sampleJSON);
result.should.eql(sampleHTML);
done();
})
})
describe('teamcity', function(){
it('should create a red message when there is a failure', function(done){
var message = 'something happened in Teamcity with a failure run!';
var result = teamcity.prepareHipChatMessage(message);
result.color.should.eql('red');
done();
})
it('should create a yellow message when there is no failure', function(done){
var message = 'our team city is soo awesome that we have only success';
var result = teamcity.prepareHipChatMessage(message);
result.color.should.eql('yellow');
done();
})
})
})