test-inventory 0.12.0 → 0.12.2
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 +145 -0
- package/README.md +3 -1
- package/dist/ast.d.ts +7 -2
- package/dist/ast.js +43 -3
- package/dist/case-titles.d.ts +5 -11
- package/dist/case-titles.js +69 -55
- package/dist/config-runs.d.ts +19 -2
- package/dist/config-runs.js +380 -91
- package/dist/config.d.ts +0 -5
- package/dist/config.js +0 -7
- package/dist/dependency-hash.js +1 -32
- package/dist/diagnostics.js +17 -2
- package/dist/diff.d.ts +2 -45
- package/dist/extract.d.ts +13 -3
- package/dist/extract.js +837 -89
- package/dist/frameworks/bun.js +47 -24
- package/dist/frameworks/common.d.ts +4 -2
- package/dist/frameworks/common.js +10 -11
- package/dist/frameworks/jasmine-registration.d.ts +47 -0
- package/dist/frameworks/jasmine-registration.js +632 -0
- package/dist/frameworks/jasmine.d.ts +7 -1
- package/dist/frameworks/jasmine.js +65 -70
- package/dist/frameworks/jest.d.ts +2 -2
- package/dist/frameworks/jest.js +126 -51
- package/dist/frameworks/test-functions.js +3 -1
- package/dist/frameworks/vitest.d.ts +2 -3
- package/dist/frameworks/vitest.js +80 -16
- package/dist/generator-steps.d.ts +56 -0
- package/dist/generator-steps.js +254 -0
- package/dist/model.d.ts +37 -5
- package/dist/mutation-arrays.d.ts +25 -0
- package/dist/mutation-arrays.js +229 -0
- package/dist/mutation-calls.d.ts +33 -0
- package/dist/mutation-calls.js +774 -0
- package/dist/mutation-order.d.ts +19 -0
- package/dist/mutation-order.js +55 -0
- package/dist/mutation-references.d.ts +109 -0
- package/dist/mutation-references.js +462 -0
- package/dist/mutation-returns.d.ts +13 -0
- package/dist/mutation-returns.js +71 -0
- package/dist/node-scripts.d.ts +6 -1
- package/dist/node-scripts.js +79 -11
- package/dist/options.d.ts +2 -0
- package/dist/options.js +6 -1
- package/dist/records.d.ts +5 -3
- package/dist/records.js +81 -28
- package/dist/scan-file.d.ts +18 -4
- package/dist/scan-file.js +44 -5
- package/dist/scan-source.js +2 -1
- package/dist/scan.js +30 -13
- package/dist/types.d.ts +45 -1
- package/dist/values.d.ts +72 -18
- package/dist/values.js +651 -172
- package/dist/vitest-concurrency.d.ts +16 -0
- package/dist/vitest-concurrency.js +55 -0
- package/package.json +6 -6
- package/schema/v1.json +1 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** The two pre-Vitest-5 scheduling options, which the runner merges independently. */
|
|
2
|
+
interface Options {
|
|
3
|
+
concurrent?: boolean;
|
|
4
|
+
sequential?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface VitestConcurrency extends Options {
|
|
7
|
+
chainConcurrent: boolean;
|
|
8
|
+
chainSequential: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type ConcurrencyRules = 'chain' | 'exclusive' | 'fallback' | 'explicit';
|
|
11
|
+
export declare function concurrencyRules(version: [number, number] | null, patch?: number): ConcurrencyRules | null;
|
|
12
|
+
/** Compute a suite's two options after applying its modifiers and the options from its parent. */
|
|
13
|
+
export declare function suiteConcurrency(parent: Options, own: VitestConcurrency, rules: ConcurrencyRules): Options;
|
|
14
|
+
/** Resolve the test after its project's default and the options of its tags are known. */
|
|
15
|
+
export declare function legacyVitestParallel(rules: ConcurrencyRules, suites: readonly (VitestConcurrency | undefined)[], test: VitestConcurrency | undefined, tag: boolean | undefined, configured: boolean | null | undefined): boolean;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function concurrencyRules(version, patch = 0) {
|
|
2
|
+
if (!version || version[0] >= 5)
|
|
3
|
+
return null;
|
|
4
|
+
const [major, minor] = version;
|
|
5
|
+
if (major < 2)
|
|
6
|
+
return 'chain';
|
|
7
|
+
if (major === 2 && (minor === 0 || (minor === 1 && patch < 3)))
|
|
8
|
+
return 'exclusive';
|
|
9
|
+
if (major === 4 && (minor > 1 || (minor === 1 && patch >= 6)))
|
|
10
|
+
return 'explicit';
|
|
11
|
+
return 'fallback';
|
|
12
|
+
}
|
|
13
|
+
/** Compute a suite's two options after applying its modifiers and the options from its parent. */
|
|
14
|
+
export function suiteConcurrency(parent, own, rules) {
|
|
15
|
+
const parallel = own.concurrent ?? parent.concurrent;
|
|
16
|
+
const sequential = own.sequential ?? parent.sequential;
|
|
17
|
+
const { chainConcurrent, chainSequential } = own;
|
|
18
|
+
if (rules === 'chain')
|
|
19
|
+
return {
|
|
20
|
+
concurrent: chainConcurrent || (!chainSequential && parallel),
|
|
21
|
+
sequential: chainSequential || (!chainConcurrent && sequential),
|
|
22
|
+
};
|
|
23
|
+
if (rules === 'exclusive') {
|
|
24
|
+
const wantsParallel = parallel === true || (chainConcurrent && !chainSequential);
|
|
25
|
+
const wantsSequential = sequential === true || (chainSequential && !chainConcurrent);
|
|
26
|
+
return { concurrent: wantsParallel && !wantsSequential, sequential: wantsSequential && !wantsParallel };
|
|
27
|
+
}
|
|
28
|
+
// From 2.1.3 a suite's explicit request beats its inherited options. Contradictory requests clear both flags.
|
|
29
|
+
const wantsParallel = chainConcurrent || own.concurrent === true || own.sequential === false;
|
|
30
|
+
const wantsSequential = chainSequential || own.sequential === true || own.concurrent === false;
|
|
31
|
+
const useParallel = wantsParallel || (parallel && !wantsSequential);
|
|
32
|
+
const useSequential = wantsSequential || (sequential && !wantsParallel);
|
|
33
|
+
return { concurrent: useParallel && !useSequential, sequential: useSequential && !useParallel };
|
|
34
|
+
}
|
|
35
|
+
/** Resolve the test after its project's default and the options of its tags are known. */
|
|
36
|
+
export function legacyVitestParallel(rules, suites, test, tag, configured) {
|
|
37
|
+
if (configured === null) {
|
|
38
|
+
return [false, true, undefined].every((value) => legacyVitestParallel(rules, suites, test, tag, value));
|
|
39
|
+
}
|
|
40
|
+
let inherited = {
|
|
41
|
+
concurrent: configured,
|
|
42
|
+
sequential: configured === false && rules !== 'exclusive' && rules !== 'chain' ? true : undefined,
|
|
43
|
+
};
|
|
44
|
+
for (const suite of suites) {
|
|
45
|
+
if (suite)
|
|
46
|
+
inherited = suiteConcurrency(inherited, suite, rules);
|
|
47
|
+
}
|
|
48
|
+
const concurrent = test?.concurrent ?? inherited.concurrent;
|
|
49
|
+
const sequential = test?.sequential ?? inherited.sequential;
|
|
50
|
+
const useParallel = test?.chainConcurrent === true || (test?.chainSequential && concurrent !== undefined ? false : concurrent);
|
|
51
|
+
const useSequential = test?.chainSequential === true || (!test?.chainConcurrent && sequential);
|
|
52
|
+
const effective = useParallel ?? tag;
|
|
53
|
+
const fallback = !useSequential && configured === true;
|
|
54
|
+
return rules === 'explicit' ? (effective ?? fallback) : effective === true || fallback;
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-inventory",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
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"
|