Files
cypress/packages/server/lib/socket-ct.ts
Ryan Manuel f2bce02f5d fix: issue with compilation failures in component testing (#21599)
* fix: issue with compilation failures in component testing

* add tests

* fix tests

* Refactor tests

* Fix tests

* Refactor tests

* Fix tests

* Fix paths for dependencies in system tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* test fix for initial esbuild failures

* Fix tests

* Add back ESLintPlugin

* Add comments around our special esbuild handling logic in vite

* Code cleanup and additional test scenario

* Add config syntax error tests

* Improve tests

* Update comment and remove unused variable

* Remove unneeded hook in webpack dev server

* Disable dev server overlay

* Revert "Remove unneeded hook in webpack dev server"

This reverts commit 98b2f269ae.

* PR comments

* Accidental removal

* Fix dedent

* PR comments
2022-05-25 18:02:05 -05:00

29 lines
988 B
TypeScript

import Debug from 'debug'
import type * as socketIo from '@packages/socket'
import devServer from '@packages/server/lib/plugins/dev-server'
import { SocketBase } from '@packages/server/lib/socket-base'
import type { DestroyableHttpServer } from '@packages/server/lib/util/server_destroy'
const debug = Debug('cypress:server:socket-ct')
export class SocketCt extends SocketBase {
constructor (config: Record<string, any>) {
super(config)
// should we use this option at all for component testing 😕?
if (config.watchForFileChanges) {
devServer.emitter.on('dev-server:compile:success', ({ specFile }) => {
this.toRunner('dev-server:compile:success', { specFile })
})
}
}
startListening (server: DestroyableHttpServer, automation, config, options) {
return super.startListening(server, automation, config, options, {
onSocketConnection (socket: socketIo.SocketIOServer) {
debug('do onSocketConnection')
},
})
}
}