Skip to content

Commit 6a9fd06

Browse files
keywordnewBridgeAR
authored andcommitted
test: include expected result in error messages
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]>
1 parent abf8bae commit 6a9fd06

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/doctool/test-doctool-html.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,20 @@ testData.forEach((item) => {
115115
assert.ifError(err);
116116

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

122123
// Testing the insertion of Google Analytics script when
123124
// an analytics id is provided. Should not be present by default
124125
if (includeAnalytics) {
125-
assert(actual.includes('google-analytics.com'),
126-
'Google Analytics script was not present');
126+
assert(actual.includes(scriptDomain),
127+
`Google Analytics script was not present in "${actual}"`);
127128
} else {
128-
assert.strictEqual(actual.includes('google-analytics.com'), false,
129-
'Google Analytics script was present');
129+
assert.strictEqual(actual.includes(scriptDomain), false,
130+
'Google Analytics script was present in ' +
131+
`"${actual}"`);
130132
}
131133
}));
132134
}));

0 commit comments

Comments
 (0)