@nx/playwright 17.3.0-beta.1 → 17.3.0-beta.3
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/playwright",
|
|
3
|
-
"version": "17.3.0-beta.
|
|
3
|
+
"version": "17.3.0-beta.3",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"homepage": "https://nx.dev",
|
|
6
6
|
"private": false,
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"directory": "packages/playwright"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nx/devkit": "17.3.0-beta.
|
|
36
|
-
"@nx/eslint": "17.3.0-beta.
|
|
37
|
-
"@nx/js": "17.3.0-beta.
|
|
35
|
+
"@nx/devkit": "17.3.0-beta.3",
|
|
36
|
+
"@nx/eslint": "17.3.0-beta.3",
|
|
37
|
+
"@nx/js": "17.3.0-beta.3",
|
|
38
38
|
"tslib": "^2.3.0",
|
|
39
39
|
"minimatch": "3.0.5"
|
|
40
40
|
},
|
|
@@ -36,7 +36,11 @@ async function playwrightExecutor(options, context) {
|
|
|
36
36
|
exports.playwrightExecutor = playwrightExecutor;
|
|
37
37
|
function createArgs(opts, exclude = ['skipInstall']) {
|
|
38
38
|
const args = [];
|
|
39
|
-
|
|
39
|
+
const { testFiles, ...rest } = opts;
|
|
40
|
+
if (testFiles) {
|
|
41
|
+
args.push(...testFiles);
|
|
42
|
+
}
|
|
43
|
+
for (const key in rest) {
|
|
40
44
|
if (exclude.includes(key))
|
|
41
45
|
continue;
|
|
42
46
|
const value = opts[key];
|
|
@@ -43,6 +43,14 @@
|
|
|
43
43
|
"type": "string",
|
|
44
44
|
"description": "Only run tests that do not match this regular expression"
|
|
45
45
|
},
|
|
46
|
+
"testFiles": {
|
|
47
|
+
"alias": "t",
|
|
48
|
+
"type": "array",
|
|
49
|
+
"description": "Test files to run",
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
46
54
|
"headed": {
|
|
47
55
|
"type": "boolean",
|
|
48
56
|
"description": "Run tests in headed browsers",
|
|
@@ -6,6 +6,7 @@ const path = require("path");
|
|
|
6
6
|
const init_1 = require("../init/init");
|
|
7
7
|
const add_linter_1 = require("../../utils/add-linter");
|
|
8
8
|
const versions_1 = require("@nx/js/src/utils/versions");
|
|
9
|
+
const js_1 = require("@nx/js");
|
|
9
10
|
async function configurationGenerator(tree, options) {
|
|
10
11
|
const tasks = [];
|
|
11
12
|
tasks.push(await (0, init_1.default)(tree, {
|
|
@@ -13,13 +14,34 @@ async function configurationGenerator(tree, options) {
|
|
|
13
14
|
skipPackageJson: options.skipPackageJson,
|
|
14
15
|
}));
|
|
15
16
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
17
|
+
const hasTsConfig = tree.exists((0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.json'));
|
|
18
|
+
const offsetFromProjectRoot = (0, devkit_1.offsetFromRoot)(projectConfig.root);
|
|
16
19
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), projectConfig.root, {
|
|
17
|
-
offsetFromRoot:
|
|
20
|
+
offsetFromRoot: offsetFromProjectRoot,
|
|
18
21
|
projectRoot: projectConfig.root,
|
|
19
22
|
webServerCommand: options.webServerCommand ?? null,
|
|
20
23
|
webServerAddress: options.webServerAddress ?? null,
|
|
21
24
|
...options,
|
|
22
25
|
});
|
|
26
|
+
if (!hasTsConfig) {
|
|
27
|
+
tree.write(`${projectConfig.root}/tsconfig.json`, JSON.stringify({
|
|
28
|
+
extends: (0, js_1.getRelativePathToRootTsConfig)(tree, projectConfig.root),
|
|
29
|
+
compilerOptions: {
|
|
30
|
+
allowJs: true,
|
|
31
|
+
outDir: `${offsetFromProjectRoot}dist/out-tsc`,
|
|
32
|
+
module: 'commonjs',
|
|
33
|
+
sourceMap: false,
|
|
34
|
+
},
|
|
35
|
+
include: [
|
|
36
|
+
'**/*.ts',
|
|
37
|
+
'**/*.js',
|
|
38
|
+
`${offsetFromProjectRoot}playwright.config.ts`,
|
|
39
|
+
`${offsetFromProjectRoot}**/*.spec.ts`,
|
|
40
|
+
`${offsetFromProjectRoot}**/*.spec.js`,
|
|
41
|
+
`${offsetFromProjectRoot}**/*.d.ts`,
|
|
42
|
+
],
|
|
43
|
+
}, null, 2));
|
|
44
|
+
}
|
|
23
45
|
const hasPlugin = (0, devkit_1.readNxJson)(tree).plugins?.some((p) => typeof p === 'string'
|
|
24
46
|
? p === '@nx/playwright/plugin'
|
|
25
47
|
: p.plugin === '@nx/playwright/plugin');
|