Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

95
Vistas
Cypress plugins file not awaiting/asyncing on after:run

I'm slightly new to cypress and was wondering why this code wasn't working on an after run step of cypress. I ran this code using node on terminal which works fine. However, when i put it within a cypress plugins file with after:run event it doesn't reach the console.log results and doesn't have an error. Any clue?

const{ WebClient} = required('@slack/web-api')
module.exports = {on, config} => {
   on('after:run', (results) => {


      if(results){
         (async () => {
             try{
                let web = new WebClient({slacktoken})
                let result = await web.chat.postMessage({
                    channel: {channel}
                    text: "hello world" 
                })
              console.log(result)
              }
              catch(error){
                  console.log(error)
              }
         })();
      }
   }
}
almost 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The answer is add async keyword on after:run function instead of its own

const{ WebClient} = required('@slack/web-api')
module.exports = {on, config} => {
   on('after:run', async(results) => {


      if(results){
             try{
                let web = new WebClient({slacktoken})
                let result = await web.chat.postMessage({
                    channel: {channel}
                    text: "hello world" 
                })
              console.log(result)
              }
              catch(error){
                  console.log(error)
              }
      }
   }
}
almost 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda