@nx/jest 19.0.0-beta.0 → 19.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/jest",
3
- "version": "19.0.0-beta.0",
3
+ "version": "19.0.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Jest contains executors and generators allowing your workspace to use the powerful Jest testing capabilities.",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "dependencies": {
37
37
  "@jest/reporters": "^29.4.1",
38
38
  "@jest/test-result": "^29.4.1",
39
- "@nx/devkit": "19.0.0-beta.0",
40
- "@nx/js": "19.0.0-beta.0",
39
+ "@nx/devkit": "19.0.0-beta.1",
40
+ "@nx/js": "19.0.0-beta.1",
41
41
  "@phenomnomnominal/tsquery": "~5.0.1",
42
42
  "chalk": "^4.1.0",
43
43
  "identity-obj-proxy": "3.0.0",
@@ -48,7 +48,7 @@
48
48
  "resolve.exports": "1.1.0",
49
49
  "tslib": "^2.3.0",
50
50
  "yargs-parser": "21.1.1",
51
- "@nrwl/jest": "19.0.0-beta.0"
51
+ "@nrwl/jest": "19.0.0-beta.1"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
@@ -67,11 +67,24 @@ exports.createNodes = [
67
67
  };
68
68
  },
69
69
  ];
70
+ const jestValidatePath = (0, path_1.dirname)(require.resolve('jest-validate/package.json', {
71
+ paths: [(0, path_1.dirname)(require.resolve('jest-config'))],
72
+ }));
70
73
  async function buildJestTargets(configFilePath, projectRoot, options, context) {
74
+ const absConfigFilePath = (0, path_1.resolve)(context.workspaceRoot, configFilePath);
75
+ if (require.cache[absConfigFilePath]) {
76
+ for (const k of Object.keys(require.cache)) {
77
+ // Only delete the cache outside of jest-validate
78
+ // jest-validate has a Symbol which is important for jest config validation which breaks if the require cache is broken
79
+ if ((0, path_1.relative)(jestValidatePath, k).startsWith('../')) {
80
+ delete require.cache[k];
81
+ }
82
+ }
83
+ }
71
84
  const config = await (0, jest_config_1.readConfig)({
72
85
  _: [],
73
86
  $0: undefined,
74
- }, (0, path_1.resolve)(context.workspaceRoot, configFilePath));
87
+ }, absConfigFilePath);
75
88
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
76
89
  const targets = {};
77
90
  const target = (targets[options.targetName] = {