const Utils = require("../utils.js").Utils; describe("Utils", function() { describe("escape", function() { it("should escape & with &", function() { const result = Utils.escape("&"); expect("&").toEqual(result); }); it("should escape < with <", function() { const result = Utils.escape("<"); expect("<").toEqual(result); }); it("should escape > with >", function() { const result = Utils.escape(">"); expect(">").toEqual(result); }); it("should escape a string with multiple problematic characters", function() { const result = Utils.escape('\tlink text'); const expected = "<a href="#">\tlink text</a>"; expect(expected).toEqual(result); }); }); });