Skip to content

Commit 198128c

Browse files
committed
fix
1 parent d77aa29 commit 198128c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/utils/utils.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,23 @@ export function loadTestCases(
132132
}
133133
const errors = fs.readFileSync(errorFile, 'utf8');
134134
config.errors = parseYaml(errors);
135+
for (const error of config.errors) {
136+
if (error.suggestions) {
137+
error.suggestions = error.suggestions?.map((s: any) => ({
138+
output: s.output,
139+
desc: s.desc
140+
}));
141+
}
142+
}
135143
if (fixable) {
136-
let output = null;
144+
let output;
137145
try {
138146
output = fs.readFileSync(outputFile, 'utf8');
139147
} catch (_e) {
140148
writeFixtures(ruleName, inputFile);
141149
output = fs.readFileSync(outputFile, 'utf8');
142150
}
143-
config.output = output;
151+
config.output = output === config.code ? null : output;
144152
}
145153

146154
return config;

0 commit comments

Comments
 (0)