Skip to content

Commit efe300a

Browse files
authored
Read input/output code outside test section (#88)
1 parent d2e6683 commit efe300a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/transforms/v2-to-v3/transformer.spec.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ describe("v2-to-v3", () => {
1111
.map((fileName) => fileName.replace(".input.ts", ""));
1212

1313
describe.each(testFilePrefixes)(`transforms correctly using "%s" data`, (testFilePrefix) => {
14+
const inputPath = join(fixtureDir, testFilePrefix + `.input.ts`);
15+
const outputPath = join(fixtureDir, testFilePrefix + `.output.ts`);
16+
const inputCode = readFileSync(inputPath, "utf8");
17+
const outputCode = readFileSync(outputPath, "utf8");
18+
const input = { path: inputPath, source: inputCode };
19+
1420
it.each([{}, { parser: "ts" }])("with testOptions: %o", (testOptions) => {
15-
const path = join(fixtureDir, testFilePrefix + `.input.ts`);
16-
const source = readFileSync(path, "utf8");
17-
const input = { path, source };
18-
const expectedOutput = readFileSync(join(fixtureDir, testFilePrefix + `.output.ts`), "utf8");
19-
runInlineTest(transformer, null, input, expectedOutput, testOptions);
21+
runInlineTest(transformer, null, input, outputCode, testOptions);
2022
});
2123
});
2224
});

0 commit comments

Comments
 (0)