We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d77aa29 commit 198128cCopy full SHA for 198128c
tests/utils/utils.ts
@@ -132,15 +132,23 @@ export function loadTestCases(
132
}
133
const errors = fs.readFileSync(errorFile, 'utf8');
134
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
143
if (fixable) {
- let output = null;
144
+ let output;
145
try {
146
output = fs.readFileSync(outputFile, 'utf8');
147
} catch (_e) {
148
writeFixtures(ruleName, inputFile);
149
150
- config.output = output;
151
+ config.output = output === config.code ? null : output;
152
153
154
return config;
0 commit comments