fix: Tests

This commit is contained in:
Sidharth Vinod 2022-10-10 21:57:22 +08:00
parent 960ea450e9
commit ba436cc37a
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
2 changed files with 3 additions and 3 deletions

View File

@ -17,10 +17,10 @@
(async () => { (async () => {
try { try {
console.log('rendering'); console.log('rendering');
await mermaid.mermaidAPI.render('graphDiv', `>`); await mermaid.mermaidAPI.renderAsync('graphDiv', `>`);
} catch (e) {} } catch (e) {}
await mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => { await mermaid.mermaidAPI.renderAsync('graphDiv', `graph LR\n a --> b`, (html) => {
document.getElementById('graph').innerHTML = html; document.getElementById('graph').innerHTML = html;
}); });
})(); })();

View File

@ -19,7 +19,7 @@
function rerender(text) { function rerender(text) {
const graphText = `graph TD const graphText = `graph TD
A[${text}] -->|Get money| B(Go shopping)`; A[${text}] -->|Get money| B(Go shopping)`;
mermaid.mermaidAPI.render('id', graphText).then((svg) => { mermaid.mermaidAPI.renderAsync('id', graphText).then((svg) => {
console.log('\x1b[35m%s\x1b[0m', '>> graph', svg); console.log('\x1b[35m%s\x1b[0m', '>> graph', svg);
document.getElementById('graph').innerHTML = svg; document.getElementById('graph').innerHTML = svg;
}); });