Skip to content

Commit

Permalink
test: include expected result in error messages
Browse files Browse the repository at this point in the history
PR-URL: #16039
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
keywordnew authored and MylesBorins committed Oct 11, 2017
1 parent f849655 commit e9f6a62
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/doctool/test-doctool-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,20 @@ testData.forEach((item) => {
assert.ifError(err);

const actual = output.replace(spaces, '');
const scriptDomain = 'google-analytics.com';
// Assert that the input stripped of all whitespace contains the
// expected list
assert(actual.includes(expected));

// Testing the insertion of Google Analytics script when
// an analytics id is provided. Should not be present by default
if (includeAnalytics) {
assert(actual.includes('google-analytics.com'),
'Google Analytics script was not present');
assert(actual.includes(scriptDomain),
`Google Analytics script was not present in "${actual}"`);
} else {
assert.strictEqual(actual.includes('google-analytics.com'), false,
'Google Analytics script was present');
assert.strictEqual(actual.includes(scriptDomain), false,
'Google Analytics script was present in ' +
`"${actual}"`);
}
}));
}));
Expand Down

0 comments on commit e9f6a62

Please sign in to comment.