mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-04 22:30:00 -06:00
fix: allow usage of ts-node in sub-processes (#20762)
This commit is contained in:
committed by
GitHub
parent
61f7cfc592
commit
f898ea7963
@@ -1001,15 +1001,17 @@ export class ProjectLifecycleManager {
|
||||
|
||||
private forkConfigProcess () {
|
||||
const configProcessArgs = ['--projectRoot', this.projectRoot, '--file', this.configFilePath]
|
||||
// allow the use of ts-node in subprocesses tests by removing the env constant from it
|
||||
// without this line, packages/ts/register.js never registers the ts-node module for config and
|
||||
// run_plugins can't use the config module.
|
||||
const { CYPRESS_INTERNAL_E2E_TESTING_SELF, ...env } = process.env
|
||||
|
||||
env.NODE_OPTIONS = process.env.ORIGINAL_NODE_OPTIONS || ''
|
||||
|
||||
const childOptions: ForkOptions = {
|
||||
stdio: 'pipe',
|
||||
cwd: path.dirname(this.configFilePath),
|
||||
env: {
|
||||
...process.env,
|
||||
NODE_OPTIONS: process.env.ORIGINAL_NODE_OPTIONS || '',
|
||||
// DEBUG: '*',
|
||||
},
|
||||
env,
|
||||
execPath: this.ctx.nodePath ?? undefined,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user