From c67e8396e3a8a0507b5a447fcb16448a13cd3ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Feje=C5=A1?= Date: Wed, 10 Jan 2018 17:23:06 +0100 Subject: [PATCH] add 2 tests, escapeHTML & escapeRegExp --- test/escapeHTML/escapeHTML.test.js | 1 + test/escapeRegExp/escapeRegExp.test.js | 1 + 2 files changed, 2 insertions(+) diff --git a/test/escapeHTML/escapeHTML.test.js b/test/escapeHTML/escapeHTML.test.js index 593de146e..fd116668e 100644 --- a/test/escapeHTML/escapeHTML.test.js +++ b/test/escapeHTML/escapeHTML.test.js @@ -5,6 +5,7 @@ test('Testing escapeHTML', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof escapeHTML === 'function', 'escapeHTML is a Function'); + t.equal(escapeHTML('Me & you'), '<a href="#">Me & you</a>', "Escapes a string for use in HTML"); //t.deepEqual(escapeHTML(args..), 'Expected'); //t.equal(escapeHTML(args..), 'Expected'); //t.false(escapeHTML(args..), 'Expected'); diff --git a/test/escapeRegExp/escapeRegExp.test.js b/test/escapeRegExp/escapeRegExp.test.js index 17a65e25d..507b53eb8 100644 --- a/test/escapeRegExp/escapeRegExp.test.js +++ b/test/escapeRegExp/escapeRegExp.test.js @@ -5,6 +5,7 @@ test('Testing escapeRegExp', (t) => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape t.true(typeof escapeRegExp === 'function', 'escapeRegExp is a Function'); + t.equal(escapeRegExp('(test)'), '\\(test\\)', "Escapes a string to use in a regular expression"); //t.deepEqual(escapeRegExp(args..), 'Expected'); //t.equal(escapeRegExp(args..), 'Expected'); //t.false(escapeRegExp(args..), 'Expected');