Store in snapshot LOCs that errored
This commit is contained in:
parent
b8f0e55905
commit
4951db8b1c
2 changed files with 2841 additions and 5 deletions
File diff suppressed because it is too large
Load diff
|
@ -6,7 +6,7 @@ const readline = require("readline");
|
||||||
const updateSnapshot = process.argv.includes("-u");
|
const updateSnapshot = process.argv.includes("-u");
|
||||||
const snapshotPath = ".travis/check-strict-null-errors.snapshot";
|
const snapshotPath = ".travis/check-strict-null-errors.snapshot";
|
||||||
const shouldCount = /^src/;
|
const shouldCount = /^src/;
|
||||||
let errors = 0;
|
let errors = [];
|
||||||
|
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
input: process.stdin,
|
input: process.stdin,
|
||||||
|
@ -16,14 +16,15 @@ const rl = readline.createInterface({
|
||||||
|
|
||||||
rl.on("line", line => {
|
rl.on("line", line => {
|
||||||
if (shouldCount.test(line)) {
|
if (shouldCount.test(line)) {
|
||||||
errors++;
|
errors = [...errors, line];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
rl.on("close", () => {
|
rl.on("close", () => {
|
||||||
|
const output = errors.join("\n") + "\n";
|
||||||
if (updateSnapshot) {
|
if (updateSnapshot) {
|
||||||
fs.writeFileSync(snapshotPath, errors);
|
fs.writeFileSync(snapshotPath, output);
|
||||||
} else {
|
} else {
|
||||||
console.log(errors);
|
console.log(output);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue