Skip to content

Commit cc92dd7

Browse files
committed
Update nx
1 parent c3ac24f commit cc92dd7

File tree

3 files changed

+1318
-486
lines changed

3 files changed

+1318
-486
lines changed

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
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",
@@ -45,8 +45,8 @@
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",
@@ -67,7 +67,6 @@
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
}

packages/nx-infra-plugin/src/utils/test-utils.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ExecutorContext } from '@nx/devkit';
1+
import { ExecutorContext, ProjectGraph } from '@nx/devkit';
22
import * as fs from 'fs';
33
import * as path from 'path';
44
import * 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

2325
export 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
}

0 commit comments

Comments
 (0)