Browse files

Added tests and fixed bug found by tests.

  • Loading branch information...
1 parent 0377f2e commit 8687d4f3435b705121a7b828e03863c3372c1d70 Matthew Smith committed Oct 18, 2011
Showing with 39 additions and 0 deletions.
  1. +3 −0 src/jasmine.teamcity_reporter.js
  2. +36 −0 test/teamcity_reporter.html
View
3 src/jasmine.teamcity_reporter.js
@@ -74,6 +74,9 @@
},
escapeTeamcityString: function(message) {
+ if(!message)
+ return "";
+
return message.replace(/\|/g, "||")
.replace(/\'/g, "|'")
.replace(/\n/g, "|n")
View
36 test/teamcity_reporter.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <title>Console Reporter Spec</title>
+
+ <link rel="stylesheet" href="../ext/jasmine.css" type="text/css" />
+
+ <script type="text/javascript" src="../ext/jasmine.js"></script>
+ <script type="text/javascript" src="../ext/jasmine-html.js"></script>
+ <script type="text/javascript" src="../src/jasmine.teamcity_reporter.js"></script>
+</head>
+<body>
+ <script type="text/javascript">
+ describe("Basic Suite", function() {
+ it("Should pass a basic truthiness test.", function() {
+ expect(true).toEqual(true);
+ });
+
+ it("Should fail when it hits an inequal statement.", function() {
+ expect(1+1).toEqual(3);
+ });
+ });
+
+ describe("Another Suite", function() {
+ it("Should pass this test as well.", function() {
+ expect(0).toEqual(0);
+ });
+ });
+
+ jasmine.getEnv().addReporter(new jasmine.TeamcityReporter());
+ jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
+ jasmine.getEnv().execute();
+ </script>
+</body>
+</html>

0 comments on commit 8687d4f

Please sign in to comment.