Skip to content

Commit ab7f43a

Browse files
keywordnewMylesBorins
authored andcommitted
test: include expected result in error messages
PR-URL: #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>
1 parent 342ac9f commit ab7f43a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/doctool/test-doctool-html.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,20 @@ testData.forEach((item) => {
103103
assert.ifError(err);
104104

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

110111
// Testing the insertion of Google Analytics script when
111112
// an analytics id is provided. Should not be present by default
112113
if (includeAnalytics) {
113-
assert(actual.includes('google-analytics.com'),
114-
'Google Analytics script was not present');
114+
assert(actual.includes(scriptDomain),
115+
`Google Analytics script was not present in "${actual}"`);
115116
} else {
116-
assert.strictEqual(actual.includes('google-analytics.com'), false,
117-
'Google Analytics script was present');
117+
assert.strictEqual(actual.includes(scriptDomain), false,
118+
'Google Analytics script was present in ' +
119+
`"${actual}"`);
118120
}
119121
}));
120122
}));

0 commit comments

Comments
 (0)