mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-09 08:40:32 -06:00
18 lines
409 B
JavaScript
18 lines
409 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.throwErr('PLUGINS_RUN_EVENT_ERROR', eventName, err)
|
|
})
|
|
}),
|
|
}
|