describe("LineFormatter", function() { it("passes through output without colors", function() { var lineFormatter = new Drone.LineFormatter(); expect(lineFormatter.format("foo")).toEqual("foo"); }); it("sets colors", function() { var lineFormatter = new Drone.LineFormatter(); var input = "\u001B[31;31mthis is red\u001B[0m"; var expected = 'this is red'; expect(lineFormatter.format(input)).toEqual(expected); }); it("sets multiple colors", function() { var lineFormatter = new Drone.LineFormatter(); var input = "\u001B[31;31mthis is red\u001B[0m\u001B[36mthis is cyan\u001B[0m"; var expected = 'this is redthis is cyan'; expect(lineFormatter.format(input)).toEqual(expected); }); it("escapes greater than and lesser than symbols", function() { var lineFormatter = new Drone.LineFormatter(); var input = "hello"; var expected = '<blink>hello</blink>'; expect(lineFormatter.format(input)).toEqual(expected); }); });