From 2df295dc1d393cd718015fbc44e37077ac0185f1 Mon Sep 17 00:00:00 2001 From: asmsuechan Date: Sat, 22 Apr 2017 17:30:55 -0700 Subject: [PATCH] Fix styles by lint --- browser/lib/htmlTextHelper.js | 2 +- tests/lib/html-text-helper-test.js | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/browser/lib/htmlTextHelper.js b/browser/lib/htmlTextHelper.js index 884e8744..49952fbd 100644 --- a/browser/lib/htmlTextHelper.js +++ b/browser/lib/htmlTextHelper.js @@ -39,5 +39,5 @@ export function encodeEntities (text) { export default { decodeEntities, - encodeEntities, + encodeEntities } diff --git a/tests/lib/html-text-helper-test.js b/tests/lib/html-text-helper-test.js index c61b3d16..a476c0dd 100644 --- a/tests/lib/html-text-helper-test.js +++ b/tests/lib/html-text-helper-test.js @@ -9,15 +9,15 @@ test('htmlTextHelper#decodeEntities should return encoded text (string)', t => { // [input, expected] const testCases = [ ['<a href=', 'Boostnote"], - ["<\\?php\n var = 'hoge';", "<\\?php\n var = 'hoge';"], - ["&", "&"], + ['var test = 'test'', 'var test = \'test\''], + ['<a href='https://boostnote.io'>Boostnote', 'Boostnote'], + ['<\\\\?php\n var = 'hoge';', '<\\\\?php\n var = \'hoge\';'], + ['&', '&'] ] testCases.forEach(testCase => { - const [input, expected] = testCase; - t.is(htmlTextHelper.decodeEntities(input), expected, `Test for decodeEntities() input: ${input} expected: ${expected}`); + const [input, expected] = testCase + t.is(htmlTextHelper.decodeEntities(input), expected, `Test for decodeEntities() input: ${input} expected: ${expected}`) }) }) @@ -25,28 +25,28 @@ test('htmlTextHelper#decodeEntities() should return decoded text (string)', t => // [input, expected] const testCases = [ ['Boostnote", '<a href='https://boostnote.io'>Boostnote'], - ["Boostnote', '<a href='https://boostnote.io'>Boostnote'], + [' { - const [input, expected] = testCase; - t.is(htmlTextHelper.encodeEntities(input), expected, `Test for encodeEntities() input: ${input} expected: ${expected}`); + const [input, expected] = testCase + t.is(htmlTextHelper.encodeEntities(input), expected, `Test for encodeEntities() input: ${input} expected: ${expected}`) }) }) // Integration test test(t => { const testCases = [ - "var test = 'test'", - "Boostnote", - "", + 'var test = \'test\'', + 'Boostnote', + '' ] testCases.forEach(testCase => { const encodedText = htmlTextHelper.encodeEntities(testCase) const decodedText = htmlTextHelper.decodeEntities(encodedText) - t.is(decodedText, testCase, `Integration test for encodedText() and decodedText()`); + t.is(decodedText, testCase, 'Integration test through encodedText() and decodedText()') }) })