fix(detox): fix detox to work with yarn pnp (#18444)
This commit is contained in:
parent
5e51cd6eb5
commit
d892a297db
@ -1,5 +1,5 @@
|
|||||||
import { ExecutorContext } from '@nx/devkit';
|
import { ExecutorContext } from '@nx/devkit';
|
||||||
import { join } from 'path';
|
import { resolve as pathResolve } from 'path';
|
||||||
import { ChildProcess, fork } from 'child_process';
|
import { ChildProcess, fork } from 'child_process';
|
||||||
|
|
||||||
import { DetoxBuildOptions } from './schema';
|
import { DetoxBuildOptions } from './schema';
|
||||||
@ -35,10 +35,10 @@ export function runCliBuild(
|
|||||||
) {
|
) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
childProcess = fork(
|
childProcess = fork(
|
||||||
join(workspaceRoot, './node_modules/detox/local-cli/cli.js'),
|
require.resolve('detox/local-cli/cli.js'),
|
||||||
['build', ...createDetoxBuildOptions(options)],
|
['build', ...createDetoxBuildOptions(options)],
|
||||||
{
|
{
|
||||||
cwd: join(workspaceRoot, projectRoot),
|
cwd: pathResolve(workspaceRoot, projectRoot),
|
||||||
env: process.env,
|
env: process.env,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
readTargetOptions,
|
readTargetOptions,
|
||||||
} from '@nx/devkit';
|
} from '@nx/devkit';
|
||||||
import { names } from '@nx/devkit';
|
import { names } from '@nx/devkit';
|
||||||
import { join } from 'path';
|
import { resolve as pathResolve } from 'path';
|
||||||
import { ChildProcess, fork } from 'child_process';
|
import { ChildProcess, fork } from 'child_process';
|
||||||
|
|
||||||
import { DetoxBuildOptions } from '../build/schema';
|
import { DetoxBuildOptions } from '../build/schema';
|
||||||
@ -59,10 +59,10 @@ function runCliTest(
|
|||||||
) {
|
) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
childProcess = fork(
|
childProcess = fork(
|
||||||
join(workspaceRoot, './node_modules/detox/local-cli/cli.js'),
|
require.resolve('detox/local-cli/cli.js'),
|
||||||
['test', ...createDetoxTestOptions(options)],
|
['test', ...createDetoxTestOptions(options)],
|
||||||
{
|
{
|
||||||
cwd: join(workspaceRoot, projectRoot),
|
cwd: pathResolve(workspaceRoot, projectRoot),
|
||||||
env: process.env,
|
env: process.env,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user