mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-11 17:50:01 -06:00
18 lines
434 B
JavaScript
18 lines
434 B
JavaScript
const Promise = require('bluebird')
|
|
|
|
const errors = require('../errors')
|
|
const plugins = require('../plugins')
|
|
|
|
module.exports = {
|
|
execute: Promise.method((eventName, config = {}, ...args) => {
|
|
if (!plugins.has(eventName)) return
|
|
|
|
return plugins.execute(eventName, ...args)
|
|
.catch((err) => {
|
|
err = err || {}
|
|
|
|
errors.throw('PLUGINS_RUN_EVENT_ERROR', eventName, err.stack || err.message || err)
|
|
})
|
|
}),
|
|
}
|