Skip to content

Commit

Permalink
Fix electron test
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvalencik committed Mar 23, 2022
1 parent 0e0c126 commit 1f0fcb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions test/electron/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<title>Neon Electron Test</title>
</head>
<body>
<h1 id="greeting"></h1>

<!-- You can also require other files to run in this process -->
<script src="./renderer.js"></script>
</body>
Expand Down
7 changes: 6 additions & 1 deletion test/electron/preload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const native = require("./index.node");

window.addEventListener("DOMContentLoaded", () => {
document.getElementById("greeting").innerText = native.hello();
document.body.appendChild(
Object.assign(document.createElement("h1"), {
id: "greeting",
innerText: native.hello(),
})
);
});

0 comments on commit 1f0fcb7

Please sign in to comment.