File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed
packages/nx-infra-plugin/src Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,17 @@ import * as fs from 'fs';
22import * as path from 'path' ;
33import executor from './executor' ;
44import { LocalizationExecutorSchema } from './schema' ;
5- import { createTempDir , cleanupTempDir , createMockContext } from '../../utils/test-utils' ;
6- import { writeFileText , writeJson , readFileText } from '../../utils' ;
5+ import {
6+ writeFileText ,
7+ writeJson ,
8+ cleanupTempDir ,
9+ readFileText ,
10+ createTempDir ,
11+ createMockContext ,
12+ findWorkspaceRoot ,
13+ } from '../../utils' ;
14+
15+ const WORKSPACE_ROOT = findWorkspaceRoot ( ) ;
716
817const PROJECT_SUBPATH = [ 'packages' , 'test-lib' ] as const ;
918
@@ -122,6 +131,16 @@ describe('LocalizationExecutor E2E', () => {
122131 tempDir = createTempDir ( 'nx-localization-e2e-' ) ;
123132 context = createMockContext ( { root : tempDir } ) ;
124133 fixture = await createLocalizationTestFixture ( tempDir ) ;
134+
135+ const devextremeNodeModules = path . join (
136+ WORKSPACE_ROOT ,
137+ 'packages' ,
138+ 'devextreme' ,
139+ 'node_modules' ,
140+ ) ;
141+
142+ const tempNodeModules = path . join ( fixture . projectDir , 'node_modules' ) ;
143+ fs . symlinkSync ( devextremeNodeModules , tempNodeModules , 'junction' ) ;
125144 } ) ;
126145
127146 afterEach ( ( ) => {
Original file line number Diff line number Diff line change @@ -41,3 +41,17 @@ export function createMockContext(options: MockContextOptions = {}): ExecutorCon
4141 } ,
4242 } ;
4343}
44+
45+ export function findWorkspaceRoot ( ) : string {
46+ let dir = process . cwd ( ) ;
47+ while ( dir !== path . dirname ( dir ) ) {
48+ if (
49+ fs . existsSync ( path . join ( dir , 'nx.json' ) )
50+ || fs . existsSync ( path . join ( dir , 'pnpm-workspace.yaml' ) )
51+ ) {
52+ return dir ;
53+ }
54+ dir = path . dirname ( dir ) ;
55+ }
56+ throw new Error ( 'Could not find workspace root' ) ;
57+ }
You can’t perform that action at this time.
0 commit comments