github.com/marinho/drone@v0.2.1-0.20140504195434-d3ba962e89a7/cmd/droned/assets/test/line_formatter_test.js (about) 1 describe("LineFormatter", function() { 2 it("passes through output without colors", function() { 3 var lineFormatter = new Drone.LineFormatter(); 4 expect(lineFormatter.format("foo")).toEqual("foo"); 5 }); 6 7 it("sets colors", function() { 8 var lineFormatter = new Drone.LineFormatter(); 9 var input = "\u001B[31;31mthis is red\u001B[0m"; 10 var expected = '<span style="color:red;">this is red</span>'; 11 expect(lineFormatter.format(input)).toEqual(expected); 12 }); 13 14 it("sets multiple colors", function() { 15 var lineFormatter = new Drone.LineFormatter(); 16 var input = "\u001B[31;31mthis is red\u001B[0m\u001B[36mthis is cyan\u001B[0m"; 17 var expected = '<span style="color:red;">this is red</span><span style="color:cyan;">this is cyan</span>'; 18 expect(lineFormatter.format(input)).toEqual(expected); 19 }); 20 21 it("escapes greater than and lesser than symbols", function() { 22 var lineFormatter = new Drone.LineFormatter(); 23 var input = "<blink>hello</blink>"; 24 var expected = '<blink>hello</blink>'; 25 expect(lineFormatter.format(input)).toEqual(expected); 26 27 }); 28 });