Skip to content

Commit d141262

Browse files
authored
Remove dependency on runInlineTest from testUtils (#256)
1 parent 9d2a674 commit d141262

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { readdirSync } from "fs";
22
import { readFile } from "fs/promises";
3-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
4-
// @ts-ignore: Could not find a declaration file for module 'jscodeshift/dist/testUtils'
5-
import { runInlineTest } from "jscodeshift/dist/testUtils";
3+
import jscodeshift from "jscodeshift";
64
import { join } from "path";
75

8-
import transformer from "./transformer";
6+
import transform from "./transformer";
97

108
describe("v2-to-v3", () => {
119
jest.setTimeout(30000);
@@ -43,7 +41,17 @@ describe("v2-to-v3", () => {
4341
`transforms: %s.%s`,
4442
async (filePrefix, fileExtension) => {
4543
const { input, outputCode } = await getTestMetadata(subDirPath, filePrefix, fileExtension);
46-
runInlineTest(transformer, null, input, outputCode);
44+
45+
const output = transform(input, {
46+
j: jscodeshift,
47+
jscodeshift,
48+
// eslint-disable-next-line @typescript-eslint/no-empty-function
49+
stats: () => {},
50+
// eslint-disable-next-line @typescript-eslint/no-empty-function
51+
report: () => {},
52+
});
53+
54+
expect(output.trim()).toEqual(outputCode.trim());
4755
}
4856
);
4957
});

0 commit comments

Comments
 (0)