@nx/detox 20.4.4 → 20.5.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 +6 -6
- package/src/generators/application/files/app/.detoxrc.json.template +1 -1
- package/src/generators/application/files/{app → non-ts-solution}/jest.config.json.template +1 -2
- package/src/generators/application/files/ts-solution/jest.config.ts.template +30 -0
- package/src/generators/application/lib/create-files.js +10 -0
- package/src/generators/application/lib/normalize-options.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/detox",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.5.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Detox contains executors and generators for allowing your workspace to use the powerful Detox integration testing capabilities.",
|
|
6
6
|
"keywords": [
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"main": "./index",
|
|
28
28
|
"types": "index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@nx/devkit": "20.
|
|
31
|
-
"@nx/jest": "20.
|
|
32
|
-
"@nx/js": "20.
|
|
33
|
-
"@nx/eslint": "20.
|
|
34
|
-
"@nx/react": "20.
|
|
30
|
+
"@nx/devkit": "20.5.0-beta.1",
|
|
31
|
+
"@nx/jest": "20.5.0-beta.1",
|
|
32
|
+
"@nx/js": "20.5.0-beta.1",
|
|
33
|
+
"@nx/eslint": "20.5.0-beta.1",
|
|
34
|
+
"@nx/react": "20.5.0-beta.1",
|
|
35
35
|
"tslib": "^2.3.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
"testEnvironment": "detox/runners/jest/testEnvironment",
|
|
14
14
|
"verbose": true,
|
|
15
15
|
"setupFilesAfterEnv": ["<rootDir>/test-setup.ts"],
|
|
16
|
-
|
|
16
|
+
"transform": {
|
|
17
17
|
"^.+\\.(ts|js|html)$": [
|
|
18
18
|
"ts-jest",
|
|
19
19
|
{ "tsconfig": "<rootDir>/tsconfig.e2e.json" }
|
|
20
20
|
]
|
|
21
21
|
}
|
|
22
|
-
|
|
23
22
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
<% if (js) { %>const { readFileSync } = require('fs')<% } else { %>import { readFileSync } from 'fs';<% } %>
|
|
3
|
+
|
|
4
|
+
// Reading the SWC compilation config for the spec files
|
|
5
|
+
const swcJestConfig = JSON.parse(
|
|
6
|
+
readFileSync(`${__dirname}/.spec.swcrc`, 'utf-8')
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
// Disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves
|
|
10
|
+
swcJestConfig.swcrc = false;
|
|
11
|
+
|
|
12
|
+
<% if (js) { %>module.exports =<% } else { %>export default<% } %> {
|
|
13
|
+
preset: "<%= offsetFromRoot %>jest.preset",
|
|
14
|
+
rootDir: ".",
|
|
15
|
+
testMatch: [
|
|
16
|
+
"<rootDir>/src/**/*.test.ts?(x)",
|
|
17
|
+
"<rootDir>/src/**/*.spec.ts?(x)"
|
|
18
|
+
],
|
|
19
|
+
testTimeout: 120000,
|
|
20
|
+
maxWorkers: 1,
|
|
21
|
+
globalSetup: "detox/runners/jest/globalSetup",
|
|
22
|
+
globalTeardown: "detox/runners/jest/globalTeardown",
|
|
23
|
+
reporters: ["detox/runners/jest/reporter"],
|
|
24
|
+
testEnvironment: "detox/runners/jest/testEnvironment",
|
|
25
|
+
verbose: true,
|
|
26
|
+
setupFilesAfterEnv: ["<rootDir>/test-setup.ts"],
|
|
27
|
+
transform: {
|
|
28
|
+
"^.+\\.(ts|js|html)$": ['@swc/jest', swcJestConfig]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createFiles = createFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
|
+
const add_swc_config_1 = require("@nx/js/src/utils/swc/add-swc-config");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
function createFiles(host, options) {
|
|
8
9
|
const offsetFromRoot = (0, devkit_1.offsetFromRoot)(options.e2eProjectRoot);
|
|
@@ -12,8 +13,17 @@ function createFiles(host, options) {
|
|
|
12
13
|
exec: (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(host.root)).exec,
|
|
13
14
|
offsetFromRoot,
|
|
14
15
|
rootTsConfigPath,
|
|
16
|
+
jestConfigFileName: options.isUsingTsSolutionConfig
|
|
17
|
+
? 'jest.config.ts'
|
|
18
|
+
: 'jest.config.json',
|
|
15
19
|
});
|
|
16
20
|
if (options.isUsingTsSolutionConfig) {
|
|
21
|
+
(0, add_swc_config_1.addSwcTestConfig)(host, options.e2eProjectRoot, 'es6');
|
|
22
|
+
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/ts-solution'), options.e2eProjectRoot, {
|
|
23
|
+
...options,
|
|
24
|
+
exec: (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(host.root)).exec,
|
|
25
|
+
offsetFromRoot,
|
|
26
|
+
});
|
|
17
27
|
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'tsconfig.json'), {
|
|
18
28
|
extends: `${offsetFromRoot}tsconfig.base.json`,
|
|
19
29
|
compilerOptions: {
|