/** * tests for default options * * @author Zongmin Lei */ var assert = require("assert"); var _default = require("../lib/default"); var debug = require("debug")("xss:test"); function xss(html, options) { debug(JSON.stringify(html)); var ret = _xss(html, options); debug("\t" + JSON.stringify(ret)); return ret; } describe("test default", function () { it("#stripCommentTag", function () { assert.equal(_default.stripCommentTag(""), ""); assert.equal(_default.stripCommentTag(""), ""); assert.equal(_default.stripCommentTag("xx yy"), "xx yy"); assert.equal(_default.stripCommentTag("xxyy"), "xxyy"); assert.equal( _default.stripCommentTag(" --> -->"), " --> -->" ); }); // it("#stripCommentTag benchmark", function () { // for (var i = 1; i <= 50000; i++) { // var time = Date.now(); // var attack_str = "" + "