From 63fc09ad1ccbc4da3dfb6a87b7a76145a01ab083 Mon Sep 17 00:00:00 2001
From: jgallego <jgallego@verdnatura.es>
Date: Wed, 29 Jan 2025 07:35:04 +0100
Subject: [PATCH] fix: update setupNodeEvents to use async/await for plugin
 import

---
 cypress.config.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/cypress.config.js b/cypress.config.js
index 500dda5c5d0..1924144f624 100644
--- a/cypress.config.js
+++ b/cypress.config.js
@@ -30,9 +30,11 @@ export default defineConfig({
             testFiles: '**/*.spec.js',
             supportFile: 'test/cypress/support/unit.js',
         },
-        setupNodeEvents(on, config) {
-            import('cypress-mochawesome-reporter/plugin').then((plugin) => plugin.default(on));
-            // implement node event listeners here
+        setupNodeEvents: async (on, config) => {
+            const plugin = await import('cypress-mochawesome-reporter/plugin');
+            plugin.default(on);
+
+            return config;
         },
         viewportWidth: 1280,
         viewportHeight: 720,