Files
cypress/packages/server/lib/plugins/run_events.js
Emily Rohrbough 1c5a67fa92 fix: handle async before:spec event handler (#26055)
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2023-03-13 08:53:59 -05:00

18 lines
396 B
JavaScript

const Promise = require('bluebird')
const errors = require('../errors')
const plugins = require('../plugins')
module.exports = {
execute: Promise.method((eventName, ...args) => {
if (!plugins.has(eventName)) return
return plugins.execute(eventName, ...args)
.catch((err) => {
err = err || {}
errors.throwErr('PLUGINS_RUN_EVENT_ERROR', eventName, err)
})
}),
}