Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
El archivo de complementos de Cypress no espera/sincroniza después de: ejecutar

Soy un poco nuevo en Cypress y me preguntaba por qué este código no funcionaba en un paso posterior a la ejecución de Cypress. Ejecuté este código usando el node en la terminal que funciona bien. Sin embargo, cuando lo coloco dentro de un archivo de complementos de Cypress con el evento after:run, no llega a los resultados de console.log y no tiene un error. ¿Cualquier pista?

 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 answers
Answer question

0

La respuesta es agregar una word clave asíncrona en la función after:run en lugar de la suya propia

 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!