Skip to content

Commit 3c46a6b

Browse files
committed
fix: @putout/test: UPDATE
1 parent 929435e commit 3c46a6b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/test/lib/fixture.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports.readFixture = (name, extension) => {
1717
return [
1818
dataTS,
1919
TS.ENABLED,
20+
'ts',
2021
];
2122

2223
const [eJS, dataJS] = tryCatch(readFileSync, `${name}.js`, 'utf8');
@@ -25,6 +26,7 @@ module.exports.readFixture = (name, extension) => {
2526
return [
2627
dataJS,
2728
TS.DISABLED,
29+
'js',
2830
];
2931

3032
if (extension) {
@@ -34,6 +36,7 @@ module.exports.readFixture = (name, extension) => {
3436
return [
3537
data,
3638
TS.DISABLED,
39+
extension,
3740
];
3841
}
3942

packages/test/lib/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ const transform = currify((dir, linterOptions, options, t, name, transformed = n
300300
const {plugins} = options;
301301
const full = join(dir, name);
302302
const isStr = isString(transformed);
303-
const [input, isTS] = readFixture(full, extension);
303+
const [input, isTS, currentExtension] = readFixture(full, extension);
304304

305305
if (!isStr)
306306
addons = transformed;
@@ -323,7 +323,7 @@ const transform = currify((dir, linterOptions, options, t, name, transformed = n
323323
writeFixture({
324324
full,
325325
code,
326-
extension,
326+
extension: currentExtension,
327327
});
328328
return t.pass('fixed fixture updated');
329329
}
@@ -337,7 +337,7 @@ const transformWithOptions = currify((dir, linterOptions, options, t, name, plug
337337
const {lint, extension} = linterOptions;
338338

339339
const full = join(dir, name);
340-
const [input, isTS] = readFixture(full, extension);
340+
const [input, isTS, currentExtension] = readFixture(full, extension);
341341

342342
const rule = parseRule(options);
343343

@@ -355,7 +355,7 @@ const transformWithOptions = currify((dir, linterOptions, options, t, name, plug
355355
writeFixture({
356356
full,
357357
code,
358-
extension,
358+
extension: currentExtension,
359359
});
360360
return t.pass('fixed fixture updated');
361361
}
@@ -374,7 +374,7 @@ const parseRule = ({plugins}) => {
374374
const noTransformWithOptions = currify((dir, linterOptions, options, t, name, ruleOptions) => {
375375
const {lint, extension} = linterOptions;
376376
const full = join(dir, name);
377-
const [input, isTS] = readFixture(full, extension);
377+
const [input, isTS, currentExtension] = readFixture(full, extension);
378378

379379
rmFixture(`${full}-fix`);
380380

@@ -393,7 +393,7 @@ const noTransformWithOptions = currify((dir, linterOptions, options, t, name, ru
393393
writeFixture({
394394
full,
395395
code,
396-
extension,
396+
extension: currentExtension,
397397
});
398398

399399
return t.pass('source fixture updated');

0 commit comments

Comments
 (0)