Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Feb 24, 2024
1 parent d77aa29 commit 198128c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,23 @@ export function loadTestCases(
}
const errors = fs.readFileSync(errorFile, 'utf8');
config.errors = parseYaml(errors);
for (const error of config.errors) {
if (error.suggestions) {
error.suggestions = error.suggestions?.map((s: any) => ({
output: s.output,
desc: s.desc
}));
}
}
if (fixable) {
let output = null;
let output;
try {
output = fs.readFileSync(outputFile, 'utf8');
} catch (_e) {
writeFixtures(ruleName, inputFile);
output = fs.readFileSync(outputFile, 'utf8');
}
config.output = output;
config.output = output === config.code ? null : output;
}

return config;
Expand Down

0 comments on commit 198128c

Please sign in to comment.