Skip to content

Commit ff127c5

Browse files
committed
use template literals
1 parent a16251d commit ff127c5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/helpers/helpers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ beforeEach(() => {
1313
result.pass = htmlDiffer.isEqual(expected, actual);
1414

1515
if (result.pass) {
16-
result.message = spec.markdown + '\n------\n\nExpected: Should Fail';
16+
result.message = `${spec.markdown}\n------\n\nExpected: Should Fail`;
1717
} else {
1818
const diff = htmlDiffer.firstDiff(actual, expected);
19-
result.message = 'Expected: ' + diff.expected + '\n Actual: ' + diff.actual;
19+
result.message = `Expected: ${diff.expected}\n Actual: ${diff.actual}`;
2020
}
2121
return result;
2222
}

test/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,9 @@ function fix() {
329329
if (path.extname(file) === '.md') {
330330
if (fm.test(text)) {
331331
text = fm(text);
332-
text = '---\n' + text.frontmatter + '\ngfm: false\n---\n' + text.body;
332+
text = `---\n${text.frontmatter}\ngfm: false\n---\n${text.body}`;
333333
} else {
334-
text = '---\ngfm: false\n---\n' + text;
334+
text = `---\ngfm: false\n---\n${text}`;
335335
}
336336
}
337337

@@ -372,7 +372,7 @@ function fix() {
372372
// markdown does some strange things.
373373
// it does not encode naked `>`, marked does.
374374
{
375-
const file = dir + '/amps_and_angles_encoding.html';
375+
const file = `${dir}/amps_and_angles_encoding.html`;
376376
const html = fs.readFileSync(file, 'utf8')
377377
.replace('6 > 5.', '6 > 5.');
378378

@@ -417,7 +417,7 @@ function parseArg(argv) {
417417
if (arg.length > 2) {
418418
// e.g. -abc
419419
argv = arg.substring(1).split('').map(ch => {
420-
return '-' + ch;
420+
return `-${ch}`;
421421
}).concat(argv);
422422
arg = argv.shift();
423423
} else {

0 commit comments

Comments
 (0)