Skip to content

Commit

Permalink
Add clarifying error message to validStrings test
Browse files Browse the repository at this point in the history
This helps when debugging which property is not being parsed correctly.
  • Loading branch information
ptomato committed Aug 25, 2022
1 parent bb22af8 commit 04022a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions polyfill/test/validStrings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,12 @@ function fuzzMode(mode) {
for (let prop of comparisonItems[mode]) {
let expected = generatedData[prop];
if (prop !== 'ianaName' && prop !== 'offset' && prop !== 'calendar') expected = expected || 0;
assert.equal(parsed[prop], expected);
assert.equal(parsed[prop], expected, prop);
}
console.log(`${fuzzed} => ok`);
} catch (e) {
if (e instanceof assert.AssertionError) {
console.log(`${fuzzed} => parsed wrong: expected`, e.expected, 'actual', e.actual);
console.log(`${fuzzed} => ${e.message} parsed wrong: expected`, e.expected, 'actual', e.actual);
console.log('generated data:', generatedData);
} else {
console.log(`${fuzzed} failed!`, e);
Expand Down

0 comments on commit 04022a3

Please sign in to comment.