Remove legacy exclusion from scenario tests for files with no errors (previously "detailed-" files).

This commit is contained in:
David Anson 2022-10-15 16:06:20 -07:00
parent f0bb4c639b
commit 56f379b0fc
26 changed files with 474 additions and 428 deletions

View file

@ -56,18 +56,16 @@ function createTestForFile(file) {
indices.push(match[2] ? Number.parseInt(match[2], 10) : index + 1);
}
}
if (Object.keys(expected).length > 0) {
const actual = {};
for (const error of errors) {
const rule = error.ruleNames[0];
// eslint-disable-next-line no-multi-assign
const indices = actual[rule] = actual[rule] || [];
if (indices[indices.length - 1] !== error.lineNumber) {
indices.push(error.lineNumber);
}
const actual = {};
for (const error of errors) {
const rule = error.ruleNames[0];
// eslint-disable-next-line no-multi-assign
const indices = actual[rule] = actual[rule] || [];
if (indices[indices.length - 1] !== error.lineNumber) {
indices.push(error.lineNumber);
}
t.deepEqual(actual, expected, "Too few or too many issues found.");
}
t.deepEqual(actual, expected, "Too few or too many issues found.");
// Create snapshot
const fixed = helpers.applyFixes(content, errors)
.replace(/\r\n/g, "\n");