-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathsmoke.test.ts
More file actions
32 lines (29 loc) · 971 Bytes
/
smoke.test.ts
File metadata and controls
32 lines (29 loc) · 971 Bytes
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
import { pluginTester, type TestObject } from "babel-plugin-tester";
import plugin from "../../babel/import-plugin";
const appendTitles = (tests: TestObject[]) => {
return tests.map((test) => ({ ...test, title: test.code }));
};
describe("plugin smoke tests", () => {
pluginTester({
plugin,
title: "plugin",
babelOptions: {
plugins: ["@babel/plugin-syntax-jsx"],
filename: "/someFile.js",
},
tests: appendTitles([
{
code: `import '../global.css';`,
output: `import "../global.css";`,
},
{
code: `import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry'`,
output: `import * as NativeComponentRegistry from "../../NativeComponent/NativeComponentRegistry";`,
babelOptions: {
filename:
"node_modules/react-native/packages/react-native/Libraries/Components/View/ViewNativeComponent.js",
},
},
]),
});
});