Merge pull request #415 from mirumee/fix/store-locs

Store in snapshot LOCs that errored
This commit is contained in:
Marcin Gębala 2020-02-26 16:35:11 +01:00 committed by GitHub
commit 3e21b816c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2841 additions and 5 deletions

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@ const readline = require("readline");
const updateSnapshot = process.argv.includes("-u");
const snapshotPath = ".travis/check-strict-null-errors.snapshot";
const shouldCount = /^src/;
let errors = 0;
let errors = [];
const rl = readline.createInterface({
input: process.stdin,
@ -16,14 +16,15 @@ const rl = readline.createInterface({
rl.on("line", line => {
if (shouldCount.test(line)) {
errors++;
errors = [...errors, line];
}
});
rl.on("close", () => {
const output = errors.join("\n") + "\n";
if (updateSnapshot) {
fs.writeFileSync(snapshotPath, errors);
fs.writeFileSync(snapshotPath, output);
} else {
console.log(errors);
console.log(output);
}
});