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