test-inventory 0.12.1 → 0.12.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/CHANGELOG.md +141 -0
- package/README.md +74 -49
- 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 +379 -90
- 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/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 +4 -1
- package/dist/node-scripts.js +77 -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 +2 -2
- 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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-inventory",
|
|
3
|
-
"version": "0.12.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.12.3",
|
|
4
|
+
"description": "Scan JS/TS test suites without running them: find skipped tests, diff revisions, and get commands for changed files.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"testing",
|
|
7
7
|
"playwright",
|