Skip to content

Commit 633f956

Browse files
committed
Add test
1 parent ef9ba90 commit 633f956

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/plugin/__snapshots__/html.spec.js.snap

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,32 @@ export default webViewRender(App);
2525
</html>
2626
\`;"
2727
`;
28+
29+
exports[`createContent export default webViewRender(App) with backticks 1`] = `
30+
"export default String.raw\`
31+
<!DOCTYPE html>
32+
<html>
33+
<head>
34+
<meta charset=\\"utf-8\\" />
35+
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\\" />
36+
</head>
37+
<body style=\\"margin: 0 !important;padding: 0 !important;\\">
38+
<div id=\\"root\\"></div>
39+
<script type=\\"text/javascript\\">(function(){import React from \\"react\\";
40+
import { webViewRender } from \\"react-native-react-bridge/lib/web\\";
41+
import Comp from \\"./Component\\";
42+
import \\"./example.css\\";
43+
44+
const text = \\"foo \`bar\`\\";
45+
console.log(text);
46+
47+
const App = () => {
48+
return <Comp />;
49+
};
50+
51+
export default webViewRender(App);
52+
})()</script>
53+
</body>
54+
</html>
55+
\`;"
56+
`;

src/plugin/html.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,10 @@ describe("createContent", () => {
1111
const src = readFixture(filename);
1212
expect(createContent(src)).toMatchSnapshot();
1313
});
14+
15+
it("export default webViewRender(App) with backticks", () => {
16+
const filename = "app-export-default-with-backticks.jsx";
17+
const src = readFixture(filename);
18+
expect(createContent(src)).toMatchSnapshot();
19+
});
1420
});

0 commit comments

Comments
 (0)