forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support running cypress as node process (cypress-io#16505)
This change checks if the environment variable ELECTRON_RUN_AS_NODE is set. If set to true, the cypress process is started as a normal Node.js process rather than an electron process. Consequently, the process does not require a display server to run so starting a display server is skipped.
- Loading branch information
Daniel Muller
committed
Jun 28, 2021
1 parent
20de3e5
commit d5c7765
Showing
6 changed files
with
70 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
const { | ||
contextBridge, | ||
ipcRenderer, | ||
} = require('electron') | ||
const debug = require('debug')('cypress:server:ipc') | ||
|
||
contextBridge.exposeInMainWorld('ipc', { | ||
on: (...args) => ipcRenderer.on(...args), | ||
send: (...args) => ipcRenderer.send(...args), | ||
}) | ||
try { | ||
const { | ||
contextBridge, | ||
ipcRenderer, | ||
} = require('electron') | ||
|
||
contextBridge.exposeInMainWorld('ipc', { | ||
on: (...args) => ipcRenderer.on(...args), | ||
send: (...args) => ipcRenderer.send(...args), | ||
}) | ||
} catch { | ||
debug('running as a node process, not an electron process') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters