Skip to content

Commit

Permalink
test: refactor test-doctool-html.js
Browse files Browse the repository at this point in the history
PR-URL: #10696
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
hiroppy authored and MylesBorins committed Mar 8, 2017
1 parent 743bdf9 commit 4a9a43c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/doctool/test-doctool-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const testData = [
},
];

testData.forEach(function(item) {
testData.forEach((item) => {
// Normalize expected data by stripping whitespace
const expected = item.html.replace(/\s/g, '');

Expand Down
8 changes: 4 additions & 4 deletions test/doctool/test-doctool-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const json = require('../../tools/doc/json.js');
// Test data is a list of objects with two properties.
// The file property is the file path.
// The json property is some json which will be generated by the doctool.
var testData = [
const testData = [
{
file: path.join(common.fixturesDir, 'sample_document.md'),
json: {
Expand Down Expand Up @@ -136,10 +136,10 @@ var testData = [
}
];

testData.forEach(function(item) {
fs.readFile(item.file, 'utf8', common.mustCall(function(err, input) {
testData.forEach((item) => {
fs.readFile(item.file, 'utf8', common.mustCall((err, input) => {
assert.ifError(err);
json(input, 'foo', common.mustCall(function(err, output) {
json(input, 'foo', common.mustCall((err, output) => {
assert.ifError(err);
assert.deepStrictEqual(output, item.json);
}));
Expand Down

0 comments on commit 4a9a43c

Please sign in to comment.