apextestlist 1.12.3 → 1.12.4

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/commands/apextests/list.d.ts +2 -5
  3. package/lib/commands/apextests/list.js +10 -64
  4. package/lib/commands/apextests/list.js.map +1 -1
  5. package/lib/core/listTests.d.ts +2 -0
  6. package/lib/core/listTests.js +54 -0
  7. package/lib/core/listTests.js.map +1 -0
  8. package/lib/parsers/manifestParser.d.ts +10 -0
  9. package/lib/parsers/manifestParser.js +27 -0
  10. package/lib/parsers/manifestParser.js.map +1 -0
  11. package/lib/parsers/testNameParser.d.ts +7 -0
  12. package/lib/parsers/testNameParser.js +19 -0
  13. package/lib/parsers/testNameParser.js.map +1 -0
  14. package/lib/parsers/testSuiteParser.d.ts +15 -0
  15. package/lib/parsers/testSuiteParser.js +40 -0
  16. package/lib/parsers/testSuiteParser.js.map +1 -0
  17. package/lib/readers/directorySearcher.d.ts +10 -0
  18. package/lib/readers/directorySearcher.js +82 -0
  19. package/lib/readers/directorySearcher.js.map +1 -0
  20. package/lib/readers/testSuiteSearcher.d.ts +9 -0
  21. package/lib/readers/testSuiteSearcher.js +74 -0
  22. package/lib/readers/testSuiteSearcher.js.map +1 -0
  23. package/lib/utils/concurrencyThreshold.d.ts +1 -0
  24. package/lib/utils/concurrencyThreshold.js +7 -0
  25. package/lib/utils/concurrencyThreshold.js.map +1 -0
  26. package/lib/utils/constants.d.ts +5 -0
  27. package/lib/utils/constants.js +7 -0
  28. package/lib/utils/constants.js.map +1 -0
  29. package/lib/{helpers → utils}/formatters.d.ts +1 -1
  30. package/lib/utils/formatters.js.map +1 -0
  31. package/lib/utils/getPackageDirectories.js.map +1 -0
  32. package/lib/{helpers → utils}/getRepoRoot.js +1 -1
  33. package/lib/utils/getRepoRoot.js.map +1 -0
  34. package/lib/utils/matchWildcard.d.ts +1 -0
  35. package/lib/utils/matchWildcard.js +5 -0
  36. package/lib/utils/matchWildcard.js.map +1 -0
  37. package/lib/utils/types.d.ts +22 -0
  38. package/lib/{helpers → utils}/types.js.map +1 -1
  39. package/lib/utils/validateTests.js.map +1 -0
  40. package/oclif.lock +51 -40
  41. package/oclif.manifest.json +2 -1
  42. package/package.json +2 -2
  43. package/lib/helpers/constants.d.ts +0 -2
  44. package/lib/helpers/constants.js +0 -4
  45. package/lib/helpers/constants.js.map +0 -1
  46. package/lib/helpers/formatters.js.map +0 -1
  47. package/lib/helpers/getPackageDirectories.js.map +0 -1
  48. package/lib/helpers/getRepoRoot.js.map +0 -1
  49. package/lib/helpers/parsers.d.ts +0 -32
  50. package/lib/helpers/parsers.js +0 -87
  51. package/lib/helpers/parsers.js.map +0 -1
  52. package/lib/helpers/readers.d.ts +0 -21
  53. package/lib/helpers/readers.js +0 -158
  54. package/lib/helpers/readers.js.map +0 -1
  55. package/lib/helpers/types.d.ts +0 -10
  56. package/lib/helpers/validateTests.js.map +0 -1
  57. /package/lib/{helpers → utils}/formatters.js +0 -0
  58. /package/lib/{helpers → utils}/getPackageDirectories.d.ts +0 -0
  59. /package/lib/{helpers → utils}/getPackageDirectories.js +0 -0
  60. /package/lib/{helpers → utils}/getRepoRoot.d.ts +0 -0
  61. /package/lib/{helpers → utils}/types.js +0 -0
  62. /package/lib/{helpers → utils}/validateTests.d.ts +0 -0
  63. /package/lib/{helpers → utils}/validateTests.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchWildcard.js","sourceRoot":"","sources":["../../src/utils/matchWildcard.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,IAAY;IAC1D,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,22 @@
1
+ export type SfdxProject = {
2
+ packageDirectories: Array<{
3
+ path: string;
4
+ }>;
5
+ };
6
+ export type SearchResult = {
7
+ classes: string[];
8
+ testSuites: string[];
9
+ warnings: string[];
10
+ };
11
+ export type ApextestsListResult = {
12
+ tests: string[];
13
+ command: string;
14
+ };
15
+ export type ListTestsOptions = {
16
+ format?: string;
17
+ manifest?: string;
18
+ ignoreMissingTests?: boolean;
19
+ ignoreDirs?: string[];
20
+ noWarnings?: boolean;
21
+ warn?: (msg: string) => void;
22
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/helpers/types.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateTests.js","sourceRoot":"","sources":["../../src/utils/validateTests.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,gBAA0B,EAC1B,kBAA4B;IAE5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,8CAA8C;IAC9C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,gBAAgB,CAAC,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE;QAC7C,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,GAAG,eAAe,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAClF,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;IAC7C,CAAC,CAAC,CACH,CAAC;IAEF,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ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,SAAS,CAAC;IACnB,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AACxD,CAAC"}
package/oclif.lock CHANGED
@@ -1368,10 +1368,10 @@
1368
1368
  "@nodelib/fs.scandir" "2.1.5"
1369
1369
  fastq "^1.6.0"
1370
1370
 
1371
- "@oclif/core@4.3.0", "@oclif/core@^4", "@oclif/core@^4.0.27", "@oclif/core@^4.2.10":
1372
- version "4.3.0"
1373
- resolved "https://registry.yarnpkg.com/@oclif/core/-/core-4.3.0.tgz#9a2951f05f81a4c7ae5ffcc00b2d720cca0898e6"
1374
- integrity sha512-lIzHY+JMP6evrS5E/sGijNnwrCoNtGy8703jWXcMuPOYKiFhWoAqnIm1BGgoRgmxczkbSfRsHUL/lwsSgh74Lw==
1371
+ "@oclif/core@4.3.3", "@oclif/core@^4", "@oclif/core@^4.0.27", "@oclif/core@^4.3.2":
1372
+ version "4.3.3"
1373
+ resolved "https://registry.yarnpkg.com/@oclif/core/-/core-4.3.3.tgz#a527536b62ef202c58d2b69ce9cd1e64eb3a94b1"
1374
+ integrity sha512-A0mk4nlVE+r34fl91OdglXVPwhhfzM59IhSxnOigqMkwxFgT8z3i2WlUgzmazzvzSccs2KM4N2HkTS3NEvW96g==
1375
1375
  dependencies:
1376
1376
  ansi-escapes "^4.3.2"
1377
1377
  ansis "^3.17.0"
@@ -1380,7 +1380,6 @@
1380
1380
  debug "^4.4.0"
1381
1381
  ejs "^3.1.10"
1382
1382
  get-package-type "^0.1.0"
1383
- globby "^11.1.0"
1384
1383
  indent-string "^4.0.0"
1385
1384
  is-wsl "^2.2.0"
1386
1385
  lilconfig "^3.1.3"
@@ -1388,13 +1387,15 @@
1388
1387
  semver "^7.6.3"
1389
1388
  string-width "^4.2.3"
1390
1389
  supports-color "^8"
1390
+ tinyglobby "^0.2.14"
1391
1391
  widest-line "^3.1.0"
1392
1392
  wordwrap "^1.0.0"
1393
1393
  wrap-ansi "^7.0.0"
1394
1394
 
1395
1395
  "@oclif/plugin-command-snapshot@^5.2.23":
1396
- version "5.2.38"
1397
- resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-5.2.38.tgz#a297c129b97c82de99d854b42304ef5b45c126d9"
1396
+ version "5.3.1"
1397
+ resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-5.3.1.tgz#95fbba5980c89398dfb3ade0ae733d972f217a03"
1398
+ integrity sha512-ytLavwqDuQ2+1Z4vV0lREGKf0JP6GTtVvYnrCMk9FL+C+CU6qnPyzI9fttuqwLMbfrsX8Fl8/6TT7dCWdX6HSg==
1398
1399
  dependencies:
1399
1400
  "@oclif/core" "^4"
1400
1401
  ansis "^3.17.0"
@@ -1403,7 +1404,7 @@
1403
1404
  lodash.difference "^4.5.0"
1404
1405
  lodash.get "^4.4.2"
1405
1406
  lodash.sortby "^4.7.0"
1406
- semver "^7.7.1"
1407
+ semver "^7.7.2"
1407
1408
  ts-json-schema-generator "^1.5.1"
1408
1409
 
1409
1410
  "@oclif/plugin-help@^6.2.27":
@@ -1437,6 +1438,11 @@
1437
1438
  version "0.11.0"
1438
1439
  resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
1439
1440
 
1441
+ "@pkgr/core@^0.2.7":
1442
+ version "0.2.7"
1443
+ resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.7.tgz#eb5014dfd0b03e7f3ba2eeeff506eed89b028058"
1444
+ integrity sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg==
1445
+
1440
1446
  "@pnpm/config.env-replace@^1.1.0":
1441
1447
  version "1.1.0"
1442
1448
  resolved "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz"
@@ -1474,10 +1480,10 @@
1474
1480
  strip-ansi "6.0.1"
1475
1481
  ts-retry-promise "^0.8.1"
1476
1482
 
1477
- "@salesforce/core@^8.10.3", "@salesforce/core@^8.11.0", "@salesforce/core@^8.5.1", "@salesforce/core@^8.8.0":
1478
- version "8.11.4"
1479
- resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.11.4.tgz#e4f049351540a46e12bb5c1b6574232fd4d1288b"
1480
- integrity sha512-6jrACrCmpic7mrnp4XQ6tiyx5FvHs101dQ2v+m8+aHF97036bul+GeeYuSjVp3ASh0sjR5CotYf7R65chd4H+A==
1483
+ "@salesforce/core@^8.10.3", "@salesforce/core@^8.12.0", "@salesforce/core@^8.5.1", "@salesforce/core@^8.8.0":
1484
+ version "8.14.0"
1485
+ resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.14.0.tgz#fcdd8b641221fee668b95ed2ede56b251668077c"
1486
+ integrity sha512-Ta1aY15TfgxLyFNNlkw60Mm3dDtiEb50TSp3/wzrbuMgkEGvFBEZQca/ChrjANXhpw8pURDUTzL4VV/1eGCHrQ==
1481
1487
  dependencies:
1482
1488
  "@jsforce/jsforce-node" "^3.8.2"
1483
1489
  "@salesforce/kit" "^3.2.2"
@@ -1565,11 +1571,11 @@
1565
1571
  terminal-link "^3.0.0"
1566
1572
 
1567
1573
  "@salesforce/source-deploy-retrieve@^12.16.5":
1568
- version "12.19.7"
1569
- resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.19.7.tgz#7385702f9436577341490ae66de059b06bf0dff7"
1570
- integrity sha512-VlAHMEOkZsMD6WxUhtOt+dDD6uEiJ5V07+JM9S0qvlAzu4FdlOn4mLCi/z9jYjMSY9O+3Iz5W9dPo99i3LKOaw==
1574
+ version "12.19.10"
1575
+ resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.19.10.tgz#56818cc729bc21625b0653ad8b184c86023261b8"
1576
+ integrity sha512-FfiX+Y96QnLjabpWjOxJgGq5Kh+ZQaP+RJa71DO/DtFFa0SlGW+VWqVzjSnNboHyq+nPF6DPDm1wT633zbEYvw==
1571
1577
  dependencies:
1572
- "@salesforce/core" "^8.11.0"
1578
+ "@salesforce/core" "^8.12.0"
1573
1579
  "@salesforce/kit" "^3.2.3"
1574
1580
  "@salesforce/ts-types" "^2.0.12"
1575
1581
  "@salesforce/types" "^1.3.0"
@@ -2540,7 +2546,7 @@ ansi-styles@^6.1.0, ansi-styles@^6.2.1:
2540
2546
  version "6.2.1"
2541
2547
  resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz"
2542
2548
 
2543
- ansis@^3.17.0, ansis@^3.3.2:
2549
+ ansis@^3.16.0, ansis@^3.17.0, ansis@^3.3.2:
2544
2550
  version "3.17.0"
2545
2551
  resolved "https://registry.yarnpkg.com/ansis/-/ansis-3.17.0.tgz#fa8d9c2a93fe7d1177e0c17f9eeb562a58a832d7"
2546
2552
 
@@ -2892,7 +2898,7 @@ chalk@^2.4.2:
2892
2898
  escape-string-regexp "^1.0.5"
2893
2899
  supports-color "^5.3.0"
2894
2900
 
2895
- chalk@^4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0:
2901
+ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0:
2896
2902
  version "4.1.2"
2897
2903
  resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
2898
2904
  dependencies:
@@ -3916,9 +3922,10 @@ faye@^1.4.0:
3916
3922
  tough-cookie "*"
3917
3923
  tunnel-agent "*"
3918
3924
 
3919
- fdir@^6.4.2:
3920
- version "6.4.3"
3921
- resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.3.tgz#011cdacf837eca9b811c89dbb902df714273db72"
3925
+ fdir@^6.4.4:
3926
+ version "6.4.6"
3927
+ resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.6.tgz#2b268c0232697063111bbf3f64810a2a741ba281"
3928
+ integrity sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==
3922
3929
 
3923
3930
  file-entry-cache@^6.0.1:
3924
3931
  version "6.0.1"
@@ -4525,9 +4532,10 @@ ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.0, ignore@^5.3.2:
4525
4532
  version "5.3.2"
4526
4533
  resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz"
4527
4534
 
4528
- ignore@^7.0.3:
4529
- version "7.0.3"
4530
- resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.3.tgz#397ef9315dfe0595671eefe8b633fec6943ab733"
4535
+ ignore@^7.0.3, ignore@^7.0.5:
4536
+ version "7.0.5"
4537
+ resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9"
4538
+ integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==
4531
4539
 
4532
4540
  immediate@~3.0.5:
4533
4541
  version "3.0.6"
@@ -5668,21 +5676,21 @@ object.values@^1.2.0:
5668
5676
  es-object-atoms "^1.0.0"
5669
5677
 
5670
5678
  oclif@^4.15.26:
5671
- version "4.17.46"
5672
- resolved "https://registry.yarnpkg.com/oclif/-/oclif-4.17.46.tgz#c7bd4315ae4903ad5f9893f6d6e7b3b78c4209fb"
5673
- integrity sha512-huMvamv0zzIXrCbW5sgy40P1L6fJjPe4IfZKSmkmuPNGSpTy+fcNZ0gYwIuMlxiT3RarLYxYie+RVTyJLE3zXw==
5679
+ version "4.18.1"
5680
+ resolved "https://registry.yarnpkg.com/oclif/-/oclif-4.18.1.tgz#697c10712f022a4d8b596b15868a149fcbca3e8d"
5681
+ integrity sha512-C5w/kUuIH3WxtjSfg3vxbdinT1dZuFoNaU7YhBTRx/FshO4WNHPsRqLgFFdx94dezkbskMJFcESS6i5RM96YSw==
5674
5682
  dependencies:
5675
5683
  "@aws-sdk/client-cloudfront" "^3.787.0"
5676
5684
  "@aws-sdk/client-s3" "^3.787.0"
5677
5685
  "@inquirer/confirm" "^3.1.22"
5678
5686
  "@inquirer/input" "^2.2.4"
5679
5687
  "@inquirer/select" "^2.5.0"
5680
- "@oclif/core" "^4.2.10"
5688
+ "@oclif/core" "^4.3.2"
5681
5689
  "@oclif/plugin-help" "^6.2.27"
5682
5690
  "@oclif/plugin-not-found" "^3.2.48"
5683
5691
  "@oclif/plugin-warn-if-update-available" "^3.1.38"
5692
+ ansis "^3.16.0"
5684
5693
  async-retry "^1.3.3"
5685
- chalk "^4"
5686
5694
  change-case "^4"
5687
5695
  debug "^4.4.0"
5688
5696
  ejs "^3.1.10"
@@ -6030,11 +6038,12 @@ pretty-quick@^3.3.1:
6030
6038
  tslib "^2.6.2"
6031
6039
 
6032
6040
  pretty-quick@^4.0.0:
6033
- version "4.1.1"
6034
- resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-4.1.1.tgz#8a0c883e4beeb0eddbe7eda50d7b1251d4f72968"
6041
+ version "4.2.2"
6042
+ resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-4.2.2.tgz#0fc31da666f182fe14e119905fc9829b5b85a234"
6043
+ integrity sha512-uAh96tBW1SsD34VhhDmWuEmqbpfYc/B3j++5MC/6b3Cb8Ow7NJsvKFhg0eoGu2xXX+o9RkahkTK6sUdd8E7g5w==
6035
6044
  dependencies:
6036
- find-up "^5.0.0"
6037
- ignore "^7.0.3"
6045
+ "@pkgr/core" "^0.2.7"
6046
+ ignore "^7.0.5"
6038
6047
  mri "^1.2.0"
6039
6048
  picocolors "^1.1.1"
6040
6049
  picomatch "^4.0.2"
@@ -6369,9 +6378,10 @@ semver@^6.0.0, semver@^6.3.1:
6369
6378
  version "6.3.1"
6370
6379
  resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz"
6371
6380
 
6372
- semver@^7.3.4, semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3, semver@^7.7.1:
6373
- version "7.7.1"
6374
- resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f"
6381
+ semver@^7.3.4, semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3, semver@^7.7.1, semver@^7.7.2:
6382
+ version "7.7.2"
6383
+ resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58"
6384
+ integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==
6375
6385
 
6376
6386
  sentence-case@^3.0.4:
6377
6387
  version "3.0.4"
@@ -6847,11 +6857,12 @@ tinyexec@^1.0.0:
6847
6857
  resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-1.0.1.tgz#70c31ab7abbb4aea0a24f55d120e5990bfa1e0b1"
6848
6858
  integrity sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==
6849
6859
 
6850
- tinyglobby@^0.2.9:
6851
- version "0.2.10"
6852
- resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.10.tgz#e712cf2dc9b95a1f5c5bbd159720e15833977a0f"
6860
+ tinyglobby@^0.2.14, tinyglobby@^0.2.9:
6861
+ version "0.2.14"
6862
+ resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.14.tgz#5280b0cf3f972b050e74ae88406c0a6a58f4079d"
6863
+ integrity sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==
6853
6864
  dependencies:
6854
- fdir "^6.4.2"
6865
+ fdir "^6.4.4"
6855
6866
  picomatch "^4.0.2"
6856
6867
 
6857
6868
  tldts-core@^6.1.52:
@@ -33,6 +33,7 @@
33
33
  "name": "format",
34
34
  "required": false,
35
35
  "summary": "Format of the output.",
36
+ "default": "sf",
36
37
  "hasDynamicHelp": false,
37
38
  "multiple": false,
38
39
  "type": "option"
@@ -99,5 +100,5 @@
99
100
  ]
100
101
  }
101
102
  },
102
- "version": "1.12.3"
103
+ "version": "1.12.4"
103
104
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "apextestlist",
3
3
  "description": "A plugin that generates a list of apex test and test suite names for use in CI/CD pipelines.",
4
- "version": "1.12.3",
4
+ "version": "1.12.4",
5
5
  "dependencies": {
6
- "@oclif/core": "4.3.0",
6
+ "@oclif/core": "4.3.3",
7
7
  "@salesforce/core": "^8.8.0",
8
8
  "@salesforce/sf-plugins-core": "^11.3.12",
9
9
  "@salesforce/source-deploy-retrieve": "^12.16.5",
@@ -1,2 +0,0 @@
1
- export declare const SFDX_PROJECT_FILE_NAME = "sfdx-project.json";
2
- export declare const SEARCHABLE_METADATA_FOLDERS: string[];
@@ -1,4 +0,0 @@
1
- 'use strict';
2
- export const SFDX_PROJECT_FILE_NAME = 'sfdx-project.json';
3
- export const SEARCHABLE_METADATA_FOLDERS = ['classes', 'triggers', 'testSuites'];
4
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/helpers/formatters.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAc,EAAE,KAAe;IAC9D,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,IAAI;YACP,OAAO,OAAO,CAAC,OAAO,CAAC;gBACrB,KAAK;gBACL,OAAO,EAAE,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;aACtC,CAAC,CAAC;QACL,KAAK,KAAK;YACR,OAAO,OAAO,CAAC,OAAO,CAAC;gBACrB,KAAK;gBACL,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;aACzB,CAAC,CAAC;QACL;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getPackageDirectories.js","sourceRoot":"","sources":["../../src/helpers/getPackageDirectories.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,UAAoB;IAC9D,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,MAAM,WAAW,EAAE,CAAC;IAE3D,IAAI,CAAC,QAAQ,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,MAAM,cAAc,GAAW,MAAM,QAAQ,CAAC,gBAAgB,EAAE,O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est file, reads that file and returns the classes,
3
- * triggers and test suites members with their types as prefix.
4
- *
5
- * For example, as ApexClass:MyClass.
6
- *
7
- * @param manifestFile the path to the manifest file
8
- * @returns a list of strings with the type and member names
9
- */
10
- export declare function extractTypeNamesFromManifestFile(manifestFile: string): Promise<string[]>;
11
- /**
12
- * Analyzes the content of a test suite xml file and returns the Apex classes
13
- * included in it.
14
- *
15
- * @param data string with the content of the test suite xml file
16
- * @returns a list of test classes names in the test suite
17
- */
18
- export declare function parseTestSuiteFile(data: string): string[];
19
- /**
20
- * Parses the line in an Apex file that contains the test names.
21
- *
22
- * @param testNames names of the tests in an Apex file line
23
- * @returns list of the test classes
24
- */
25
- export declare function parseTestsNames(testNames: string[] | null): string[];
26
- /**
27
- * Parses the line in an Apex file that contains the test suites names.
28
- *
29
- * @param testNames names of the test suites in an Apex file line
30
- * @returns list of the test suites
31
- */
32
- export declare function parseTestSuitesNames(testSuitesNames: string[] | null): string[];
@@ -1,87 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-call */
2
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
5
- 'use strict';
6
- import { existsSync } from 'node:fs';
7
- import { ComponentSet } from '@salesforce/source-deploy-retrieve';
8
- import { Parser } from 'xml2js';
9
- /**
10
- * Given a certain manifest file, reads that file and returns the classes,
11
- * triggers and test suites members with their types as prefix.
12
- *
13
- * For example, as ApexClass:MyClass.
14
- *
15
- * @param manifestFile the path to the manifest file
16
- * @returns a list of strings with the type and member names
17
- */
18
- export async function extractTypeNamesFromManifestFile(manifestFile) {
19
- const result = [];
20
- if (!manifestFile || !existsSync(manifestFile)) {
21
- return result;
22
- }
23
- const componentSet = await ComponentSet.fromManifest({ manifestPath: manifestFile });
24
- for (const component of componentSet) {
25
- const typeName = component.type.name;
26
- if (['ApexClass', 'ApexTrigger', 'ApexTestSuite'].includes(typeName)) {
27
- result.push(`${typeName}:${component.fullName}`);
28
- }
29
- }
30
- return result.sort((a, b) => a.localeCompare(b));
31
- }
32
- /**
33
- * Analyzes the content of a test suite xml file and returns the Apex classes
34
- * included in it.
35
- *
36
- * @param data string with the content of the test suite xml file
37
- * @returns a list of test classes names in the test suite
38
- */
39
- export function parseTestSuiteFile(data) {
40
- const result = [];
41
- new Parser().parseString(data, (error, parsed) => {
42
- if (error) {
43
- throw error;
44
- }
45
- parsed.ApexTestSuite.testClassName.forEach((testSuite) => {
46
- result.push(testSuite);
47
- });
48
- });
49
- return result.sort();
50
- }
51
- /**
52
- * Parses the line in an Apex file that contains the test names.
53
- *
54
- * @param testNames names of the tests in an Apex file line
55
- * @returns list of the test classes
56
- */
57
- export function parseTestsNames(testNames) {
58
- if (!testNames || testNames.length === 0) {
59
- return [];
60
- }
61
- // remove the prefix @Tests
62
- return testNames
63
- .join(' ')
64
- .replace(/(@tests\s*:\s*)/gi, '')
65
- .replace(/[,\s]+/g, ' ')
66
- .trim()
67
- .split(' ');
68
- }
69
- /**
70
- * Parses the line in an Apex file that contains the test suites names.
71
- *
72
- * @param testNames names of the test suites in an Apex file line
73
- * @returns list of the test suites
74
- */
75
- export function parseTestSuitesNames(testSuitesNames) {
76
- if (!testSuitesNames || testSuitesNames.length === 0) {
77
- return [];
78
- }
79
- // remove the prefix @testsuites
80
- return testSuitesNames
81
- .join(' ')
82
- .replace(/(@testsuites\s*:\s*)/gi, '')
83
- .replace(/[,\s]+/g, ' ')
84
- .trim()
85
- .split(' ');
86
- }
87
- //# sourceMappingURL=parsers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/helpers/parsers.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,4DAA4D;AAC5D,0DAA0D;AAC1D,+DAA+D;AAC/D,YAAY,CAAC;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAG,MAAM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;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,SAA0B;IACxD,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,2BAA2B;IAC3B,OAAO,SAAS;SACb,IAAI,CAAC,GAAG,CAAC;SACT,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,IAAI,EAAE;SACN,KAAK,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAAgC;IACnE,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,gCAAgC;IAChC,OAAO,eAAe;SACnB,IAAI,CAAC,GAAG,CAAC;SACT,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC;SACrC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,IAAI,EAAE;SACN,KAAK,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC"}
@@ -1,21 +0,0 @@
1
- import { SearchResult } from './types.js';
2
- export declare function getConcurrencyThreshold(): number;
3
- /**
4
- * Given a certain directory, search its contents for files that end with
5
- * '.testSuite-meta.xml' and extract the class names mentioned in the test
6
- * suites.
7
- *
8
- * @param directory directory within the project to search for files
9
- * @returns a Promise<string> with a list of test names
10
- */
11
- export declare function searchDirectoryForTestNamesInTestSuites(directory: string, packageDirectories: string[]): Promise<string[]>;
12
- export declare function matchWildcard(wildcard: string, test: string): boolean;
13
- /**
14
- * Given a certain directory, search its contents for files that end with '.cls' or '.trigger'.
15
- * Extracts the test names from the annotations on those files, and returns a list with those.
16
- *
17
- * @param directory directory within the project to search for files
18
- * @param names names of test files
19
- * @returns list of test classes
20
- */
21
- export declare function searchDirectoryForTestClasses(directory: string, names: string[] | null): Promise<SearchResult>;
@@ -1,158 +0,0 @@
1
- /* eslint-disable no-console */
2
- 'use strict';
3
- import { availableParallelism } from 'node:os';
4
- import { readdirSync, readFileSync } from 'node:fs';
5
- import { queue } from 'async';
6
- import { parseTestsNames, parseTestSuiteFile, parseTestSuitesNames } from './parsers.js';
7
- const TEST_NAME_REGEX = /@tests\s*:\s*([^/\n]+)/gi;
8
- const TEST_SUITE_NAME_REGEX = /@testsuites\s*:\s*([^/\n]+)/gi;
9
- const TEST_CLASS_ANNOTATION_REGEX = /@istest/gi;
10
- export function getConcurrencyThreshold() {
11
- const AVAILABLE_PARALLELISM = availableParallelism ? availableParallelism() : Infinity;
12
- return Math.min(AVAILABLE_PARALLELISM, 6);
13
- }
14
- /**
15
- * Given a certain directory, search its contents for files that end with
16
- * '.testSuite-meta.xml' and extract the class names mentioned in the test
17
- * suites.
18
- *
19
- * @param directory directory within the project to search for files
20
- * @returns a Promise<string> with a list of test names
21
- */
22
- export async function searchDirectoryForTestNamesInTestSuites(directory, packageDirectories) {
23
- const testClassesNames = new Set();
24
- let readDir;
25
- try {
26
- readDir = readdirSync(directory, { recursive: true });
27
- }
28
- catch (error) {
29
- throw new Error(`Invalid or inaccessible directory: ${directory}`);
30
- }
31
- // Gets the list of test suites
32
- const suiteFiles = readDir.filter((file) => file.endsWith('.testSuite-meta.xml'));
33
- const wildcards = new Set();
34
- let requiresWildcardSearch = false;
35
- // Function that handles the parsing of test suites and helps to build the
36
- // list of test classes for the next steps
37
- const testSuiteNameHandler = (fileName) => {
38
- const path = `${directory}/${fileName}`;
39
- const data = readFileSync(path, 'utf-8');
40
- const classes = parseTestSuiteFile(data);
41
- // TODO: Support for wildcards
42
- for (const test of classes) {
43
- if (test.includes('*')) {
44
- requiresWildcardSearch = true;
45
- wildcards.add(test);
46
- continue;
47
- }
48
- testClassesNames.add(test);
49
- }
50
- };
51
- // define the processors
52
- const testSuiteNameProcessor = queue((f, cb) => {
53
- testSuiteNameHandler(f);
54
- cb();
55
- }, getConcurrencyThreshold());
56
- // initialize the processor with the names of files we want to process
57
- await testSuiteNameProcessor.push(suiteFiles);
58
- // make sure no dangling process is left before continuing
59
- if (testSuiteNameProcessor.length() > 0) {
60
- await testSuiteNameProcessor.drain();
61
- }
62
- if (requiresWildcardSearch && packageDirectories) {
63
- for (const pkgDir of packageDirectories) {
64
- // eslint-disable-next-line no-await-in-loop
65
- const searchResult = await searchDirectoryForTestClasses(pkgDir, null);
66
- const testClassesInDir = searchResult.classes;
67
- for (const test of testClassesInDir) {
68
- // if the test class name matches the wildcard, add it to the list
69
- for (const wildcard of wildcards) {
70
- if (!matchWildcard(wildcard, test)) {
71
- continue;
72
- }
73
- testClassesNames.add(test);
74
- }
75
- }
76
- }
77
- }
78
- return Array.from(testClassesNames).sort();
79
- }
80
- export function matchWildcard(wildcard, test) {
81
- const regex = new RegExp(`^${wildcard.replace('*', '.*')}$`);
82
- return regex.test(test);
83
- }
84
- /**
85
- * Given a certain directory, search its contents for files that end with '.cls' or '.trigger'.
86
- * Extracts the test names from the annotations on those files, and returns a list with those.
87
- *
88
- * @param directory directory within the project to search for files
89
- * @param names names of test files
90
- * @returns list of test classes
91
- */
92
- export async function searchDirectoryForTestClasses(directory, names) {
93
- const testClassesNames = new Set();
94
- const testSuitesNames = new Set();
95
- const warnings = [];
96
- let readDir;
97
- try {
98
- readDir = readdirSync(directory, { recursive: true });
99
- }
100
- catch (error) {
101
- throw new Error(`Invalid or inaccessible directory: ${directory}`);
102
- }
103
- // Gets the list of Apex files (classes and triggers)
104
- const apexFiles = readDir.filter((file) => {
105
- if (!file.endsWith('.cls') && !file.endsWith('.trigger')) {
106
- return false;
107
- }
108
- const fileFullName = file.split('/').pop()?.split('.');
109
- if (!names) {
110
- return true;
111
- }
112
- if (fileFullName && fileFullName.length > 0) {
113
- const formattedName = `${fileFullName[1] === 'cls' ? 'ApexClass' : 'ApexTrigger'}:${fileFullName[0]}`;
114
- return names.includes(formattedName);
115
- }
116
- });
117
- const testClassNameHandler = (fileName) => {
118
- const path = `${directory}/${fileName}`;
119
- const data = readFileSync(path, 'utf-8');
120
- const testNameMatches = Array.from(data.matchAll(TEST_NAME_REGEX));
121
- const testSuiteMatches = Array.from(data.matchAll(TEST_SUITE_NAME_REGEX));
122
- const testClassAnnotationMatches = data.match(TEST_CLASS_ANNOTATION_REGEX);
123
- let hasAnnotation = false;
124
- if (testNameMatches.length > 0) {
125
- hasAnnotation = true;
126
- for (const match of testNameMatches) {
127
- parseTestsNames(match).forEach((testMethod) => testClassesNames.add(testMethod));
128
- }
129
- }
130
- if (testSuiteMatches.length > 0) {
131
- hasAnnotation = true;
132
- for (const match of testSuiteMatches) {
133
- parseTestSuitesNames(match).forEach((testMethod) => testSuitesNames.add(testMethod));
134
- }
135
- }
136
- if (testClassAnnotationMatches && testClassAnnotationMatches.length > 0) {
137
- hasAnnotation = true;
138
- testClassesNames.add(fileName.split('.').shift());
139
- }
140
- if (!hasAnnotation) {
141
- warnings.push(`File "${fileName}" does not contain @tests, @testsuites, or @istest annotations`);
142
- }
143
- };
144
- const testClassNameProcessor = queue((f, cb) => {
145
- testClassNameHandler(f);
146
- cb();
147
- }, getConcurrencyThreshold());
148
- await testClassNameProcessor.push(apexFiles);
149
- if (testClassNameProcessor.length() > 0) {
150
- await testClassNameProcessor.drain();
151
- }
152
- return {
153
- classes: Array.from(testClassesNames),
154
- testSuites: Array.from(testSuitesNames),
155
- warnings,
156
- };
157
- }
158
- //# sourceMappingURL=readers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readers.js","sourceRoot":"","sources":["../../src/helpers/readers.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,YAAY,CAAC;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS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[];
8
- testSuites: string[];
9
- warnings: string[];
10
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateTests.js","sourceRoot":"","sources":["../../src/helpers/validateTests.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,gBAA0B,EAC1B,kBAA4B;IAE5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,8CAA8C;IAC9C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,gBAAgB,CAAC,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE;QAC7C,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,GAAG,eAAe,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAClF,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;IAC7C,CAAC,CAAC,CACH,CAAC;IAEF,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,OAAO,EAAE,CAAC;QACzC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,mBAAmB,IAAI,6CAA6C,CAAC,CAAC;QACtF,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB,EAAE,kBAA4B;IAC/E,yDAAyD;IACzD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CA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