From d59f8780208e82e0f7b55f751ef6d148a4cdfe44 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 6 Oct 2022 17:49:10 +0800 Subject: [PATCH] fix: use async in render-after-error --- cypress/platform/render-after-error.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cypress/platform/render-after-error.html b/cypress/platform/render-after-error.html index 267ffade1..059f79345 100644 --- a/cypress/platform/render-after-error.html +++ b/cypress/platform/render-after-error.html @@ -14,15 +14,16 @@ mermaid.init({ startOnLoad: false }); mermaid.mermaidAPI.initialize({ securityLevel: 'strict' }); + (async () => { + try { + console.log('rendering'); + await mermaid.mermaidAPI.render('graphDiv', `>`); + } catch (e) {} - try { - console.log('rendering'); - mermaid.mermaidAPI.render('graphDiv', `>`); - } catch (e) {} - - mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => { - document.getElementById('graph').innerHTML = html; - }); + await mermaid.mermaidAPI.render('graphDiv', `graph LR\n a --> b`, (html) => { + document.getElementById('graph').innerHTML = html; + }); + })();