Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tests.forEach((t) => {
let testResults;
if (errorsPerFile[t.path]) {
testResults = fail({
start,
end: +new Date(),
test: { path: t.path, errorMessage: errorsPerFile[t.path] },
});
} else {
testResults = pass({ start, end: +new Date(), test: { path: t.path } });
}
onResult(t, testResults);
});
resolve();
const tooManyWarnings =
cliOptions.maxWarnings >= 0 && report.warningCount > cliOptions.maxWarnings;
if (tooManyWarnings) {
return fail({
start,
end,
test: {
path: testPath,
title: 'ESLint',
errorMessage: `${message}\nESLint found too many warnings (maximum: ${cliOptions.maxWarnings}).`,
},
});
}
const result = pass({
start,
end,
test: { path: testPath, title: 'ESLint' },
});
if (!cliOptions.quiet && report.warningCount > 0) {
result.console = [{ message, origin: '', type: 'warn' }];
}
return result;
};