Browse Source

test: include expected result in error messages

PR-URL: https://github.com/nodejs/node/pull/16039
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
v9.x-staging
Chowdhurian 7 years ago
committed by Ruben Bridgewater
parent
commit
6a9fd06173
No known key found for this signature in database GPG Key ID: F07496B3EB3C1762
  1. 10
      test/doctool/test-doctool-html.js

10
test/doctool/test-doctool-html.js

@ -115,6 +115,7 @@ 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));
@ -122,11 +123,12 @@ testData.forEach((item) => {
// 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}"`);
}
}));
}));

Loading…
Cancel
Save