mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-11 09:40:11 -06:00
Co-authored-by: Jessica Sachs <jess@jessicasachs.io> Co-authored-by: Barthélémy Ledoux <bart@cypress.io> Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com> Co-authored-by: Zach Bloomquist <github@chary.us> Co-authored-by: Dmitriy Kovalenko <dmtr.kovalenko@outlook.com> Co-authored-by: ElevateBart <ledouxb@gmail.com> Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
25 lines
613 B
JavaScript
25 lines
613 B
JavaScript
const EE = require('events')
|
|
const util = require('../util')
|
|
|
|
const wrap = (ipc, invoke, ids, [options]) => {
|
|
const devServerEvents = new EE()
|
|
|
|
ipc.on('dev-server:specs:changed', (specs) => {
|
|
devServerEvents.emit('dev-server:specs:changed', specs)
|
|
})
|
|
|
|
devServerEvents.on('dev-server:compile:error', (error) => {
|
|
ipc.send('dev-server:compile:error', error)
|
|
})
|
|
|
|
devServerEvents.on('dev-server:compile:success', () => {
|
|
ipc.send('dev-server:compile:success')
|
|
})
|
|
|
|
options.devServerEvents = devServerEvents
|
|
|
|
util.wrapChildPromise(ipc, invoke, ids, [options])
|
|
}
|
|
|
|
module.exports = { wrap }
|