test-inventory 0.4.1 → 0.6.0
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 +96 -0
- package/README.md +4 -1
- package/dist/ast.d.ts +3 -3
- package/dist/ast.js +4 -4
- package/dist/bin.js +1 -0
- package/dist/cli.d.ts +4 -2
- package/dist/cli.js +27 -7
- package/dist/config-dependencies.d.ts +62 -0
- package/dist/config-dependencies.js +231 -0
- package/dist/config-runs.d.ts +113 -0
- package/dist/config-runs.js +807 -0
- package/dist/config.d.ts +90 -0
- package/dist/config.js +652 -0
- package/dist/dependency-hash.d.ts +242 -0
- package/dist/dependency-hash.js +1458 -0
- package/dist/diagnostics.js +6 -1
- package/dist/extract.d.ts +20 -0
- package/dist/extract.js +20 -4
- package/dist/filter.d.ts +6 -0
- package/dist/filter.js +18 -1
- package/dist/frameworks/bindings.d.ts +22 -0
- package/dist/frameworks/bindings.js +19 -9
- package/dist/frameworks/common.d.ts +5 -0
- package/dist/frameworks/common.js +11 -0
- package/dist/frameworks/playwright.d.ts +2 -1
- package/dist/frameworks/playwright.js +11 -2
- package/dist/frameworks/vitest.d.ts +2 -1
- package/dist/frameworks/vitest.js +9 -3
- package/dist/hash.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/inventory.d.ts +2 -2
- package/dist/inventory.js +2 -1
- package/dist/json.js +2 -0
- package/dist/model.d.ts +9 -1
- package/dist/options.d.ts +2 -2
- package/dist/records.d.ts +58 -2
- package/dist/records.js +196 -28
- package/dist/scan-file.d.ts +13 -1
- package/dist/scan-file.js +16 -4
- package/dist/scan-source.js +1 -1
- package/dist/scan.d.ts +2 -1
- package/dist/scan.js +131 -18
- package/dist/types.d.ts +83 -7
- package/dist/values.d.ts +5 -0
- package/dist/values.js +5 -0
- package/dist/vitest-config.d.ts +6 -4
- package/dist/vitest-config.js +32 -28
- package/dist/vitest-defaults.d.ts +6 -0
- package/dist/vitest-defaults.js +16 -0
- package/package.json +10 -8
- package/schema/v1.json +200 -6
package/schema/v1.json
CHANGED
|
@@ -28,6 +28,13 @@
|
|
|
28
28
|
"summary": {
|
|
29
29
|
"$ref": "#/definitions/Summary"
|
|
30
30
|
},
|
|
31
|
+
"configs": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"$ref": "#/definitions/ConfigRecord"
|
|
35
|
+
},
|
|
36
|
+
"description": "The configs the scanned files use, sorted by path."
|
|
37
|
+
},
|
|
31
38
|
"files": {
|
|
32
39
|
"type": "array",
|
|
33
40
|
"items": {
|
|
@@ -60,6 +67,7 @@
|
|
|
60
67
|
"framework",
|
|
61
68
|
"frameworkVersion",
|
|
62
69
|
"summary",
|
|
70
|
+
"configs",
|
|
63
71
|
"files",
|
|
64
72
|
"suites",
|
|
65
73
|
"tests",
|
|
@@ -225,6 +233,67 @@
|
|
|
225
233
|
],
|
|
226
234
|
"description": "Counts over the whole scan. Each test count uses the same definition as the matching test key."
|
|
227
235
|
},
|
|
236
|
+
"ConfigRecord": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"properties": {
|
|
239
|
+
"relativeFilePath": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"description": "Path from the project root, with `/` separators."
|
|
242
|
+
},
|
|
243
|
+
"extends": {
|
|
244
|
+
"type": "array",
|
|
245
|
+
"items": {
|
|
246
|
+
"type": "string"
|
|
247
|
+
},
|
|
248
|
+
"description": "Files the config takes settings from through imports, such as a shared base config, in the order read."
|
|
249
|
+
},
|
|
250
|
+
"projects": {
|
|
251
|
+
"anyOf": [
|
|
252
|
+
{
|
|
253
|
+
"type": "array",
|
|
254
|
+
"items": {
|
|
255
|
+
"$ref": "#/definitions/ProjectRecord"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"type": "null"
|
|
260
|
+
}
|
|
261
|
+
],
|
|
262
|
+
"description": "The projects the config runs tests in: Playwright's `projects`, or one for a config without them; Vitest's, with each browser instance as one. Null when the scan can't work them out."
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"required": [
|
|
266
|
+
"relativeFilePath",
|
|
267
|
+
"extends",
|
|
268
|
+
"projects"
|
|
269
|
+
],
|
|
270
|
+
"description": "A Playwright or Vitest config that scanned files use: the nearest one in a file's folder or a folder above it, up to the root, as the runner started in that folder would. Read as code, never run."
|
|
271
|
+
},
|
|
272
|
+
"ProjectRecord": {
|
|
273
|
+
"type": "object",
|
|
274
|
+
"properties": {
|
|
275
|
+
"name": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"description": "As the runner names it: `''` for a project without a name."
|
|
278
|
+
},
|
|
279
|
+
"testDir": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "The folder the project's test files are found in, from the project root: Playwright's `testDir`, Vitest's `dir`."
|
|
282
|
+
},
|
|
283
|
+
"dependencies": {
|
|
284
|
+
"type": "array",
|
|
285
|
+
"items": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
},
|
|
288
|
+
"description": "Playwright's projects that run before this one; `[]` for Vitest."
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"required": [
|
|
292
|
+
"name",
|
|
293
|
+
"testDir",
|
|
294
|
+
"dependencies"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
228
297
|
"FileRecord": {
|
|
229
298
|
"type": "object",
|
|
230
299
|
"properties": {
|
|
@@ -235,6 +304,13 @@
|
|
|
235
304
|
"fileName": {
|
|
236
305
|
"type": "string"
|
|
237
306
|
},
|
|
307
|
+
"config": {
|
|
308
|
+
"type": [
|
|
309
|
+
"string",
|
|
310
|
+
"null"
|
|
311
|
+
],
|
|
312
|
+
"description": "The config the file uses, from the project root: the outermost config at or above it that runs it, as the runner started at the root would, else the nearest. Null when there is none."
|
|
313
|
+
},
|
|
238
314
|
"hooks": {
|
|
239
315
|
"$ref": "#/definitions/HookCounts",
|
|
240
316
|
"description": "Hooks at the top level of the file, which run around every test in it."
|
|
@@ -251,6 +327,7 @@
|
|
|
251
327
|
"required": [
|
|
252
328
|
"relativeFilePath",
|
|
253
329
|
"fileName",
|
|
330
|
+
"config",
|
|
254
331
|
"hooks",
|
|
255
332
|
"suiteCount",
|
|
256
333
|
"testCount"
|
|
@@ -677,6 +754,22 @@
|
|
|
677
754
|
],
|
|
678
755
|
"description": "Hash of the test body, ignoring whitespace and comments; null when the test has no body."
|
|
679
756
|
},
|
|
757
|
+
"dependencyHash": {
|
|
758
|
+
"type": "string",
|
|
759
|
+
"pattern": "^[0-9a-f]{16}$",
|
|
760
|
+
"description": "Hash of everything the test runs in the project: its call, the hooks, options and code of the file and of every describe around it, and the functions, classes, constants and modules these use, followed through imports. Ignores whitespace and comments. Installed packages are not in it."
|
|
761
|
+
},
|
|
762
|
+
"dependencies": {
|
|
763
|
+
"type": "array",
|
|
764
|
+
"items": {
|
|
765
|
+
"type": "string"
|
|
766
|
+
},
|
|
767
|
+
"description": "The files that went into `dependencyHash`, the test's own included, sorted, with `/` separators."
|
|
768
|
+
},
|
|
769
|
+
"hasUnfollowedDependencies": {
|
|
770
|
+
"type": "boolean",
|
|
771
|
+
"description": "Something the test reaches couldn't be followed, so a change there doesn't change `dependencyHash`."
|
|
772
|
+
},
|
|
680
773
|
"suiteId": {
|
|
681
774
|
"anyOf": [
|
|
682
775
|
{
|
|
@@ -884,7 +977,7 @@
|
|
|
884
977
|
"type": "null"
|
|
885
978
|
}
|
|
886
979
|
],
|
|
887
|
-
"description": "In milliseconds: the last `test.setTimeout()` in the body or a `beforeEach`, otherwise the nearest describe or file that sets one. Null when
|
|
980
|
+
"description": "In milliseconds: the last `test.setTimeout()` in the body or a `beforeEach`, otherwise the nearest describe or file that sets one, otherwise the config. Null when none sets it, so the runner's default applies."
|
|
888
981
|
},
|
|
889
982
|
"isSlow": {
|
|
890
983
|
"type": "boolean",
|
|
@@ -938,7 +1031,61 @@
|
|
|
938
1031
|
"type": "null"
|
|
939
1032
|
}
|
|
940
1033
|
],
|
|
941
|
-
"description": "
|
|
1034
|
+
"description": "How many times the runner runs the test again after the first run: Vitest's `repeats`, or Playwright's `repeatEach` from the config less one."
|
|
1035
|
+
},
|
|
1036
|
+
"timeoutSource": {
|
|
1037
|
+
"anyOf": [
|
|
1038
|
+
{
|
|
1039
|
+
"$ref": "#/definitions/SettingSource"
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
"type": "null"
|
|
1043
|
+
}
|
|
1044
|
+
],
|
|
1045
|
+
"description": "Where `timeout` comes from; null when nothing sets it. A null `timeout` from the config means the config sets it, but its projects set different values or the value depends on a condition, as in `process.env.CI ? 2 : 0`."
|
|
1046
|
+
},
|
|
1047
|
+
"retriesSource": {
|
|
1048
|
+
"anyOf": [
|
|
1049
|
+
{
|
|
1050
|
+
"$ref": "#/definitions/SettingSource"
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
"type": "null"
|
|
1054
|
+
}
|
|
1055
|
+
],
|
|
1056
|
+
"description": "Where `retries`, `retryDelay` and `retryCondition` come from, read as `timeoutSource` is."
|
|
1057
|
+
},
|
|
1058
|
+
"repeatsSource": {
|
|
1059
|
+
"anyOf": [
|
|
1060
|
+
{
|
|
1061
|
+
"$ref": "#/definitions/SettingSource"
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"type": "null"
|
|
1065
|
+
}
|
|
1066
|
+
],
|
|
1067
|
+
"description": "Where `repeats` comes from, read as `timeoutSource` is."
|
|
1068
|
+
},
|
|
1069
|
+
"timeoutConfigText": {
|
|
1070
|
+
"type": [
|
|
1071
|
+
"string",
|
|
1072
|
+
"null"
|
|
1073
|
+
],
|
|
1074
|
+
"description": "The config's source text for `timeout` when the config sets it under a condition, as in `process.env.CI ? 60_000 : 30_000`, shortened when long; null otherwise."
|
|
1075
|
+
},
|
|
1076
|
+
"retriesConfigText": {
|
|
1077
|
+
"type": [
|
|
1078
|
+
"string",
|
|
1079
|
+
"null"
|
|
1080
|
+
],
|
|
1081
|
+
"description": "The config's source text for `retries`, read as `timeoutConfigText` is."
|
|
1082
|
+
},
|
|
1083
|
+
"repeatsConfigText": {
|
|
1084
|
+
"type": [
|
|
1085
|
+
"string",
|
|
1086
|
+
"null"
|
|
1087
|
+
],
|
|
1088
|
+
"description": "The config's source text for `repeats`, Playwright's `repeatEach`, read as `timeoutConfigText` is."
|
|
942
1089
|
},
|
|
943
1090
|
"fixtures": {
|
|
944
1091
|
"type": "array",
|
|
@@ -1010,11 +1157,28 @@
|
|
|
1010
1157
|
"isInFunction": {
|
|
1011
1158
|
"type": "boolean",
|
|
1012
1159
|
"description": "Declared inside a plain function."
|
|
1160
|
+
},
|
|
1161
|
+
"projects": {
|
|
1162
|
+
"anyOf": [
|
|
1163
|
+
{
|
|
1164
|
+
"type": "array",
|
|
1165
|
+
"items": {
|
|
1166
|
+
"type": "string"
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
"type": "null"
|
|
1171
|
+
}
|
|
1172
|
+
],
|
|
1173
|
+
"description": "Names of the projects that run the test, of the config its file uses, after each project's files and Playwright's `grep` and `grepInvert`. `[]` when no project runs it; null when there is no config, or the scan can't tell."
|
|
1013
1174
|
}
|
|
1014
1175
|
},
|
|
1015
1176
|
"required": [
|
|
1016
1177
|
"id",
|
|
1017
1178
|
"bodyHash",
|
|
1179
|
+
"dependencyHash",
|
|
1180
|
+
"dependencies",
|
|
1181
|
+
"hasUnfollowedDependencies",
|
|
1018
1182
|
"suiteId",
|
|
1019
1183
|
"suitePath",
|
|
1020
1184
|
"relativeFilePath",
|
|
@@ -1058,6 +1222,12 @@
|
|
|
1058
1222
|
"retryDelay",
|
|
1059
1223
|
"retryCondition",
|
|
1060
1224
|
"repeats",
|
|
1225
|
+
"timeoutSource",
|
|
1226
|
+
"retriesSource",
|
|
1227
|
+
"repeatsSource",
|
|
1228
|
+
"timeoutConfigText",
|
|
1229
|
+
"retriesConfigText",
|
|
1230
|
+
"repeatsConfigText",
|
|
1061
1231
|
"fixtures",
|
|
1062
1232
|
"expectCount",
|
|
1063
1233
|
"expectedAssertions",
|
|
@@ -1069,7 +1239,8 @@
|
|
|
1069
1239
|
"caseCount",
|
|
1070
1240
|
"isInLoop",
|
|
1071
1241
|
"isInCondition",
|
|
1072
|
-
"isInFunction"
|
|
1242
|
+
"isInFunction",
|
|
1243
|
+
"projects"
|
|
1073
1244
|
],
|
|
1074
1245
|
"description": "A test, with the effective values the runner applies, including those inherited from its describes."
|
|
1075
1246
|
},
|
|
@@ -1093,14 +1264,32 @@
|
|
|
1093
1264
|
]
|
|
1094
1265
|
},
|
|
1095
1266
|
"StateSource": {
|
|
1096
|
-
"description": "Where a test's state is set: on the test, on a describe around it,
|
|
1267
|
+
"description": "Where a test's state is set: on the test, on a describe around it, at file level, or by a Vitest tag the config defines. Other values may be added in later releases.",
|
|
1268
|
+
"anyOf": [
|
|
1269
|
+
{
|
|
1270
|
+
"type": "string",
|
|
1271
|
+
"enum": [
|
|
1272
|
+
"test",
|
|
1273
|
+
"suite",
|
|
1274
|
+
"file",
|
|
1275
|
+
"config"
|
|
1276
|
+
]
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
"type": "string"
|
|
1280
|
+
}
|
|
1281
|
+
]
|
|
1282
|
+
},
|
|
1283
|
+
"SettingSource": {
|
|
1284
|
+
"description": "Where a test's run setting comes from: the test, a describe around it, the file, or the config its file uses. Other values may be added in later releases.",
|
|
1097
1285
|
"anyOf": [
|
|
1098
1286
|
{
|
|
1099
1287
|
"type": "string",
|
|
1100
1288
|
"enum": [
|
|
1101
1289
|
"test",
|
|
1102
1290
|
"suite",
|
|
1103
|
-
"file"
|
|
1291
|
+
"file",
|
|
1292
|
+
"config"
|
|
1104
1293
|
]
|
|
1105
1294
|
},
|
|
1106
1295
|
{
|
|
@@ -1238,6 +1427,7 @@
|
|
|
1238
1427
|
"removed-api",
|
|
1239
1428
|
"only-in-skipped-describe",
|
|
1240
1429
|
"config-may-change-state",
|
|
1430
|
+
"undefined-tag",
|
|
1241
1431
|
"symlink-ignored",
|
|
1242
1432
|
"invalid-import",
|
|
1243
1433
|
"globals-not-enabled",
|
|
@@ -1252,7 +1442,11 @@
|
|
|
1252
1442
|
"approximate-framework-version",
|
|
1253
1443
|
"test-in-function",
|
|
1254
1444
|
"empty-title",
|
|
1255
|
-
"bench-outside-benchmark-file"
|
|
1445
|
+
"bench-outside-benchmark-file",
|
|
1446
|
+
"config-value-unknown",
|
|
1447
|
+
"file-not-run",
|
|
1448
|
+
"forbidden-only",
|
|
1449
|
+
"dependency-not-followed"
|
|
1256
1450
|
]
|
|
1257
1451
|
},
|
|
1258
1452
|
{
|