test-inventory 0.12.0 → 0.12.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/CHANGELOG.md +10 -0
- package/README.md +2 -1
- package/dist/config-runs.js +2 -2
- package/dist/frameworks/test-functions.js +3 -1
- package/dist/node-scripts.d.ts +2 -0
- package/dist/node-scripts.js +2 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# test-inventory
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#157](https://github.com/Huldoser/test-inventory/pull/157) [`dafab8b`](https://github.com/Huldoser/test-inventory/commit/dafab8b7108fa9ee58b107e016be13a0837db5af) - Discover Playwright specs when a package script runs `playwright test` without a config file. Default file matching and ignore rules apply from the package folder.
|
|
8
|
+
|
|
9
|
+
- [#157](https://github.com/Huldoser/test-inventory/pull/157) [`dafab8b`](https://github.com/Huldoser/test-inventory/commit/dafab8b7108fa9ee58b107e016be13a0837db5af) - Update oxc-parser to 0.160.0 for TypeScript parsing fixes, including comparisons after `as` and `satisfies`.
|
|
10
|
+
|
|
11
|
+
- [#157](https://github.com/Huldoser/test-inventory/pull/157) [`dafab8b`](https://github.com/Huldoser/test-inventory/commit/dafab8b7108fa9ee58b107e016be13a0837db5af) - Recognize a re-exported Vitest test called with a title, options, a body and an extra argument.
|
|
12
|
+
|
|
3
13
|
## 0.12.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -38,7 +38,8 @@ npx test-inventory "tests/**/*.spec.ts" --framework playwright --output inventor
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Without the glob, the test files are those the project's Playwright, Vitest, Jest, Mocha, Jasmine, Cypress or
|
|
41
|
-
WebdriverIO configs run, or for node:test and Bun the files `node --test` and `bun test` run.
|
|
41
|
+
WebdriverIO configs run, or for node:test and Bun the files `node --test` and `bun test` run. A package script running
|
|
42
|
+
plain `playwright test` also discovers Playwright specs without a config. Without `--framework`, the
|
|
42
43
|
scan takes the runner the project uses, and asks for `--framework` when it uses several.
|
|
43
44
|
|
|
44
45
|
For this spec from a trading app's UI tests, `tests/alerts.spec.ts`:
|
package/dist/config-runs.js
CHANGED
|
@@ -344,8 +344,8 @@ export class ConfigRuns {
|
|
|
344
344
|
if (config === null)
|
|
345
345
|
continue;
|
|
346
346
|
}
|
|
347
|
-
//
|
|
348
|
-
if (config === null && this.framework !== 'vitest')
|
|
347
|
+
// A plain Playwright test command and Vitest both collect tests without a config.
|
|
348
|
+
if (config === null && this.framework !== 'vitest' && !command.playwrightDefaults)
|
|
349
349
|
continue;
|
|
350
350
|
const key = `${config?.file ?? ''}\0${root}`;
|
|
351
351
|
if (seen.has(key))
|
|
@@ -535,9 +535,11 @@ export class SuiteAdapter {
|
|
|
535
535
|
* so it doesn't depend on which call comes first.
|
|
536
536
|
*/
|
|
537
537
|
worthFollowing(name, chainLinks, args, held) {
|
|
538
|
+
// Vitest reads the title, options and body even when JavaScript supplies a fourth argument.
|
|
539
|
+
const declarationArgs = this.dialect.name === 'Vitest' && args.length > 3 ? args.slice(0, 3) : args;
|
|
538
540
|
return ((held && isTestName(name)) ||
|
|
539
541
|
this.looksLikeTest(chainLinks, args) ||
|
|
540
|
-
((chainLinks.length === 0 || isTestName(name)) && hasDeclarationArguments(
|
|
542
|
+
((chainLinks.length === 0 || isTestName(name)) && hasDeclarationArguments(declarationArgs)));
|
|
541
543
|
}
|
|
542
544
|
/** The framework as followed modules are read. */
|
|
543
545
|
framework() {
|
package/dist/node-scripts.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface RunnerCommand {
|
|
|
19
19
|
root: string | null;
|
|
20
20
|
/** Whether it names its config or root in a way the scan can't read: a variable, or Jest's inline JSON. */
|
|
21
21
|
unreadable: boolean;
|
|
22
|
+
/** A plain playwright test command collects its default files even without a config. */
|
|
23
|
+
playwrightDefaults?: true;
|
|
22
24
|
/** For Mocha, which takes its files and settings from them, the words after the program. */
|
|
23
25
|
args?: string[];
|
|
24
26
|
}
|
package/dist/node-scripts.js
CHANGED
|
@@ -216,6 +216,8 @@ export function runnerCommands(script, runner) {
|
|
|
216
216
|
args = args.slice(1);
|
|
217
217
|
}
|
|
218
218
|
const command = { config: null, root: null, unreadable: false };
|
|
219
|
+
if (started.program === 'playwright' && args.length === 0)
|
|
220
|
+
command.playwrightDefaults = true;
|
|
219
221
|
if (runner === 'mocha')
|
|
220
222
|
command.args = args;
|
|
221
223
|
if (runner === 'webdriverio') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-inventory",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Lists every Playwright, Vitest, Jest, Mocha, Jasmine, Cypress, WebdriverIO, node:test and Bun test from the source code, without running it: its state and why, tags, an id that survives a move, a hash of everything it runs, and the tests a change can affect.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"testing",
|
|
@@ -80,14 +80,14 @@
|
|
|
80
80
|
"lint:fix": "eslint . --fix",
|
|
81
81
|
"format": "prettier --write . --ignore-path .gitignore --ignore-path .prettierignore --ignore-path .git/info/exclude",
|
|
82
82
|
"format:check": "node scripts/format-check.ts",
|
|
83
|
-
"docs:api": "typedoc",
|
|
83
|
+
"docs:api": "cd scripts/typedoc && typedoc --options ../../typedoc.json",
|
|
84
84
|
"docs:dev": "npm run docs:api && vitepress dev docs",
|
|
85
85
|
"docs:build": "npm run docs:api && vitepress build docs",
|
|
86
86
|
"docs:preview": "vitepress preview docs",
|
|
87
87
|
"changeset": "changeset"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"oxc-parser": "0.
|
|
90
|
+
"oxc-parser": "0.160.0",
|
|
91
91
|
"picomatch": "^4.0.7",
|
|
92
92
|
"tinyglobby": "^0.2.17"
|
|
93
93
|
},
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"eslint": "~10.15.0",
|
|
103
103
|
"prettier": "3.10.1",
|
|
104
104
|
"publint": "^0.3.25",
|
|
105
|
-
"ts-json-schema-generator": "2.
|
|
105
|
+
"ts-json-schema-generator": "2.10.0",
|
|
106
106
|
"typedoc": "^0.28.20",
|
|
107
107
|
"typedoc-plugin-markdown": "^4.14.1",
|
|
108
108
|
"typedoc-vitepress-theme": "^1.1.4",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"vitest": "5.1.1"
|
|
114
114
|
},
|
|
115
115
|
"overrides": {
|
|
116
|
-
"
|
|
117
|
-
"
|
|
116
|
+
"typedoc": {
|
|
117
|
+
"minimatch": "^11.0.9"
|
|
118
118
|
},
|
|
119
119
|
"vitepress-plugin-llms": {
|
|
120
120
|
"minimatch": "^11.0.9"
|