Skip to content

Commit

Permalink
fix(detox): fix detox to work with yarn pnp (#18444)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed Aug 2, 2023
1 parent 5e51cd6 commit d892a29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/detox/src/executors/build/build.impl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ExecutorContext } from '@nx/devkit';
import { join } from 'path';
import { resolve as pathResolve } from 'path';
import { ChildProcess, fork } from 'child_process';

import { DetoxBuildOptions } from './schema';
Expand Down Expand Up @@ -35,10 +35,10 @@ export function runCliBuild(
) {
return new Promise((resolve, reject) => {
childProcess = fork(
join(workspaceRoot, './node_modules/detox/local-cli/cli.js'),
require.resolve('detox/local-cli/cli.js'),
['build', ...createDetoxBuildOptions(options)],
{
cwd: join(workspaceRoot, projectRoot),
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
}
);
Expand Down
6 changes: 3 additions & 3 deletions packages/detox/src/executors/test/test.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
readTargetOptions,
} 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 { DetoxBuildOptions } from '../build/schema';
Expand Down Expand Up @@ -59,10 +59,10 @@ function runCliTest(
) {
return new Promise((resolve, reject) => {
childProcess = fork(
join(workspaceRoot, './node_modules/detox/local-cli/cli.js'),
require.resolve('detox/local-cli/cli.js'),
['test', ...createDetoxTestOptions(options)],
{
cwd: join(workspaceRoot, projectRoot),
cwd: pathResolve(workspaceRoot, projectRoot),
env: process.env,
}
);
Expand Down

1 comment on commit d892a29

@vercel
Copy link

@vercel vercel bot commented on d892a29 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.