test: added a react application test (in the browser)

This commit is contained in:
2024-01-07 00:23:20 +01:00
parent e96c2248ee
commit 3e46055845
22 changed files with 1669 additions and 220 deletions

View File

@@ -0,0 +1,13 @@
export async function app({root}){
const states = ['started', 'tick', 'ended'];
for(let state of states){
const text = `App ${state}`;
console.log(`Test my sourcemap: ${text}`);
root.innerHTML = `<div style="align-self: center"><b>${text}</b></div>`;
await new Promise((resolve,reject)=>
setTimeout(()=>resolve(), 10)
);
}
}

View File

@@ -1 +0,0 @@
export const batman = 'bum badum badum baaaaa dum!';

View File

@@ -13,6 +13,6 @@
</head>
<body>
<div id="root">Here the app should load!</div>
<script src="./index.js" type="module"></script>
<script src="./index.mjs" type="module"></script>
</body>
</html>

View File

@@ -9,7 +9,7 @@
const [
appModule,
] = await Promise.all([
import("./batman.js"),
import("./app.mjs"),
]);
console.log("Bootstrapped, ready to go!");
@@ -20,7 +20,7 @@
}
// Start the app!
root.innerHTML = `<div style="align-self: center"><b>${appModule.batman}</b></div>`;
await appModule.app({root});
}catch(err){
console.error(err);
}