-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathremove-forward-ref.test.ts
More file actions
54 lines (47 loc) · 1.07 KB
/
remove-forward-ref.test.ts
File metadata and controls
54 lines (47 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"use strict";
const jsTests = [
"function-expression",
"arrow-function-expression",
"forward-ref-import",
"forward-ref-import-2",
"props-identifier",
"props-object-pattern",
"callee-is-member-expression",
];
const tsTests = [
"type-arguments",
"type-arguments-custom-names",
"type-arguments-type-literals",
"props-type-literal",
];
const defineTest = require("jscodeshift/dist/testUtils").defineTest;
describe("remove-forward-ref", () => {
jsTests.forEach((test) =>
defineTest(
__dirname,
"remove-forward-ref",
null,
`remove-forward-ref/${test}`
)
);
describe("typescript", () => {
beforeEach(() => {
jest.mock("../remove-forward-ref", () => {
return Object.assign(jest.requireActual("../remove-forward-ref"), {
parser: "tsx",
});
});
});
afterEach(() => {
jest.resetModules();
});
tsTests.forEach((test) => {
defineTest(
__dirname,
"remove-forward-ref",
null,
`remove-forward-ref/typescript/${test}`
);
});
});
});