File tree Expand file tree Collapse file tree 3 files changed +1385
-525
lines changed
packages/nx-infra-plugin/src/utils Expand file tree Collapse file tree 3 files changed +1385
-525
lines changed Original file line number Diff line number Diff line change 2626 "nx" : {},
2727 "private" : true ,
2828 "devDependencies" : {
29- "@nx/devkit" : " 18.3.4 " ,
30- "@nx/jest" : " 19.4.2 " ,
31- "@nx/js" : " 19.4.2 " ,
29+ "@nx/devkit" : " 22.1.3 " ,
30+ "@nx/jest" : " 22.1.3 " ,
31+ "@nx/js" : " 22.1.3 " ,
3232 "@types/jest" : " 29.5.12" ,
3333 "@types/node" : " 20.12.8" ,
3434 "@types/shelljs" : " 0.8.15" ,
4545 "jest" : " 29.7.0" ,
4646 "jspdf-autotable" : " 3.8.3" ,
4747 "lint-staged" : " 14.0.1" ,
48- "nx" : " 19.4.2 " ,
49- "nx-cloud" : " 19.0 .0" ,
48+ "nx" : " 22.1.3 " ,
49+ "nx-cloud" : " 19.1 .0" ,
5050 "postcss" : " 8.4.38" ,
5151 "shelljs" : " 0.8.5" ,
5252 "shx" : " 0.4.0" ,
6767 "form-data@>=4.0.0 <4.0.4" : " ^4.0.5" ,
6868 "pbkdf2@<=3.1.2" : " ^3.1.3" ,
6969 "sha.js@<=2.4.11" : " ^2.4.12" ,
70- "terser@<4.8.1" : " ^5.44.1" ,
7170 "rollup@<2.79.2" : " ^4.53.3" ,
7271 "json5@<1.0.2" : " ^2.2.3"
7372 }
Original file line number Diff line number Diff line change 1- import { ExecutorContext } from '@nx/devkit' ;
1+ import { ExecutorContext , ProjectGraph } from '@nx/devkit' ;
22import * as fs from 'fs' ;
33import * as path from 'path' ;
44import * as os from 'os' ;
@@ -18,6 +18,8 @@ export interface MockContextOptions {
1818 projectName ?: string ;
1919 projectRoot ?: string ;
2020 isVerbose ?: boolean ;
21+ nxJsonConfiguration ?: Record < string , unknown > ;
22+ projectGraph ?: Record < string , unknown > ;
2123}
2224
2325export function createMockContext ( options : MockContextOptions = { } ) : ExecutorContext {
@@ -26,8 +28,24 @@ export function createMockContext(options: MockContextOptions = {}): ExecutorCon
2628 projectName = 'test-lib' ,
2729 projectRoot = 'packages/test-lib' ,
2830 isVerbose = false ,
31+ nxJsonConfiguration = { } ,
2932 } = options ;
3033
34+ const projectGraph : ProjectGraph = {
35+ nodes : {
36+ [ projectName ] : {
37+ name : projectName ,
38+ type : 'lib' ,
39+ data : {
40+ root : projectRoot ,
41+ targets : { } ,
42+ } ,
43+ } ,
44+ } ,
45+ externalNodes : { } ,
46+ dependencies : { } ,
47+ } ;
48+
3149 return {
3250 root,
3351 cwd : root ,
@@ -39,5 +57,7 @@ export function createMockContext(options: MockContextOptions = {}): ExecutorCon
3957 } ,
4058 version : 2 ,
4159 } ,
60+ nxJsonConfiguration,
61+ projectGraph,
4262 } ;
4363}
You can’t perform that action at this time.
0 commit comments