@nx/jest 20.2.0-beta.3 → 20.2.0-beta.4
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": "20.2.0-beta.
|
|
3
|
+
"version": "20.2.0-beta.4",
|
|
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": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@jest/reporters": "^29.4.1",
|
|
39
39
|
"@jest/test-result": "^29.4.1",
|
|
40
|
-
"@nx/devkit": "20.2.0-beta.
|
|
41
|
-
"@nx/js": "20.2.0-beta.
|
|
40
|
+
"@nx/devkit": "20.2.0-beta.4",
|
|
41
|
+
"@nx/js": "20.2.0-beta.4",
|
|
42
42
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
43
43
|
"chalk": "^4.1.0",
|
|
44
44
|
"identity-obj-proxy": "3.0.0",
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
"extends": "<%= extendedConfig %>",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "<%= outDir %>",<% if (module) { %>
|
|
5
|
-
"module": "<%= module %>",<% } %>
|
|
6
|
-
"
|
|
5
|
+
"module": "<%= module %>",<% } if (module === 'commonjs') { %>
|
|
6
|
+
"moduleResolution": "node10",<% } if (supportTsx) { %>
|
|
7
|
+
"jsx": "react-jsx",<% } %>"types": ["jest", "node"]
|
|
7
8
|
},<% if(setupFile !== 'none') { %>
|
|
8
9
|
"files": ["src/test-setup.ts"],<% } %>
|
|
9
10
|
"include": [
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createFiles = createFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
5
|
const path_1 = require("path");
|
|
6
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
7
|
function createFiles(tree, options, presetExt) {
|
|
8
8
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
9
9
|
const filesFolder = options.setupFile === 'angular' ? '../files-angular' : '../files';
|
|
@@ -20,6 +20,12 @@ function updateTsConfig(host, options) {
|
|
|
20
20
|
let runtimeTsconfigPath = (0, devkit_1.joinPathFragments)(root, projectType === 'application' ? 'tsconfig.app.json' : 'tsconfig.lib.json');
|
|
21
21
|
if (options.runtimeTsconfigFileName) {
|
|
22
22
|
runtimeTsconfigPath = (0, devkit_1.joinPathFragments)(root, options.runtimeTsconfigFileName);
|
|
23
|
+
// If the app is Next.js it will not have a tsconfig.app.json
|
|
24
|
+
const extensions = ['js', 'ts', 'mjs', 'cjs'];
|
|
25
|
+
const hasNextConfig = extensions.some((ext) => host.exists((0, devkit_1.joinPathFragments)(root, `next.config.${ext}`)));
|
|
26
|
+
if (hasNextConfig && projectType === 'application') {
|
|
27
|
+
runtimeTsconfigPath = (0, devkit_1.joinPathFragments)(root, 'tsconfig.json');
|
|
28
|
+
}
|
|
23
29
|
if (!host.exists(runtimeTsconfigPath)) {
|
|
24
30
|
// the user provided a runtimeTsconfigFileName that doesn't exist, so we throw an error
|
|
25
31
|
throw new Error(`Cannot find the provided runtimeTsConfigFileName ("${options.runtimeTsconfigFileName}") at the project root "${root}".`);
|