Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Aug 28, 2020
1 parent 01b4fcc commit 9fb3f24
Showing 1 changed file with 33 additions and 0 deletions.
@@ -0,0 +1,33 @@
var code = ``;

const res = transform(code, {
plugins: [
function (b) {
var t = b.types;
return {
visitor: {
Program: {
enter(path) {
path.pushContainer(
"body",
t.JSXElement(
t.JSXOpeningElement(t.JSXIdentifier("div"), [], false),
t.JSXClosingElement(t.JSXIdentifier("div")),
[]
)
);
}
},
},
};
},
["../../../..", { runtime: "automatic" }],
],
});

expect(res.code).toMatchInlineSnapshot(`
"import { jsxDEV as _jsxDEV } from \\"react/jsx-dev-runtime\\";
/*#__PURE__*/
_jsxDEV(\\"div\\", {}, void 0, false, void 0, this)"
`)

0 comments on commit 9fb3f24

Please sign in to comment.