testeranto 0.173.0 → 0.177.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.
Files changed (145) hide show
  1. package/dist/common/src/PM/base.js +5 -5
  2. package/dist/common/src/PM/main.js +48 -52
  3. package/dist/common/src/PM/node.js +4 -1
  4. package/dist/common/src/PM/pure.js +4 -1
  5. package/dist/common/src/PM/web.js +4 -1
  6. package/dist/common/src/Pure.js +0 -4
  7. package/dist/common/src/Pure.test.js +1 -1
  8. package/dist/common/src/ReportServerLib.js +11 -5
  9. package/dist/common/src/esbuildConfigs/node.js +1 -3
  10. package/dist/common/src/lib/BaseSuite.js +13 -11
  11. package/dist/common/src/lib/abstractBase.js +39 -42
  12. package/dist/common/src/lib/basebuilder.js +5 -0
  13. package/dist/common/src/lib/core.js +1 -0
  14. package/dist/common/src/lib/pmProxy.js +210 -100
  15. package/dist/common/src/lib/pmProxy.test/adapter.js +2 -2
  16. package/dist/common/src/lib/pmProxy.test/implementation.js +1 -1
  17. package/dist/common/testeranto.config.js +39 -39
  18. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  19. package/dist/module/src/PM/base.js +5 -5
  20. package/dist/module/src/PM/main.js +13 -17
  21. package/dist/module/src/PM/node.js +4 -1
  22. package/dist/module/src/PM/pure.js +4 -1
  23. package/dist/module/src/PM/web.js +4 -1
  24. package/dist/module/src/Pure.js +0 -4
  25. package/dist/module/src/Pure.test.js +1 -1
  26. package/dist/module/src/ReportServerLib.js +11 -5
  27. package/dist/module/src/esbuildConfigs/node.js +1 -3
  28. package/dist/module/src/lib/BaseSuite.js +13 -11
  29. package/dist/module/src/lib/abstractBase.js +39 -42
  30. package/dist/module/src/lib/basebuilder.js +5 -0
  31. package/dist/module/src/lib/core.js +1 -0
  32. package/dist/module/src/lib/pmProxy.js +210 -100
  33. package/dist/module/src/lib/pmProxy.test/adapter.js +2 -2
  34. package/dist/module/src/lib/pmProxy.test/implementation.js +1 -1
  35. package/dist/module/testeranto.config.js +39 -39
  36. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  37. package/dist/prebuild/ReportServer.mjs +10 -4
  38. package/dist/prebuild/build.mjs +1 -1
  39. package/dist/prebuild/run.mjs +19 -22
  40. package/dist/types/src/PM/base.d.ts +1 -1
  41. package/dist/types/src/PM/node.d.ts +1 -1
  42. package/dist/types/src/PM/pure.d.ts +1 -1
  43. package/dist/types/src/PM/web.d.ts +1 -1
  44. package/dist/types/src/ReportServerLib.d.ts +1 -2
  45. package/dist/types/src/lib/BaseSuite.d.ts +2 -0
  46. package/dist/types/src/lib/abstractBase.d.ts +4 -6
  47. package/dist/types/src/lib/pmProxy.d.ts +3 -3
  48. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  49. package/package.json +2 -2
  50. package/src/PM/base.ts +6 -9
  51. package/src/PM/main.ts +17 -20
  52. package/src/PM/node.ts +6 -1
  53. package/src/PM/pure.ts +6 -1
  54. package/src/PM/web.ts +5 -1
  55. package/src/Pure.test.ts +6 -6
  56. package/src/Pure.ts +0 -8
  57. package/src/ReportServerLib.ts +10 -7
  58. package/src/esbuildConfigs/node.ts +1 -1
  59. package/src/lib/BaseSuite.ts +16 -21
  60. package/src/lib/abstractBase.ts +57 -49
  61. package/src/lib/basebuilder.ts +6 -0
  62. package/src/lib/core.ts +1 -0
  63. package/src/lib/pmProxy.test/adapter.ts +2 -2
  64. package/src/lib/pmProxy.test/implementation.ts +3 -3
  65. package/src/lib/pmProxy.test/types.ts +0 -2
  66. package/src/lib/pmProxy.ts +224 -92
  67. package/testeranto/bundles/node/core/metafile.json +2 -480
  68. package/testeranto/bundles/pure/core/metafile.json +3 -621
  69. package/testeranto/bundles/web/core/metafile.json +14384 -78
  70. package/testeranto/bundles/web/core/src/{lib/baseBuilder.test/baseBuilder.test.web.html → components/pure/ProjectPageView.test/index.html} +2 -2
  71. package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +39991 -0
  72. package/testeranto/projects.json +0 -1
  73. package/testeranto/reports/core/config.json +5 -5
  74. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +18 -0
  75. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/logs.txt +59 -0
  76. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
  77. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +27 -0
  78. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-0/butThen/happyPath.png +0 -0
  79. package/testeranto/reports/{staticSite/src/ReportServer.test.ts/index/node → core/src/components/pure/ProjectPageView.test/index/web}/type_errors.txt +20 -22
  80. package/testeranto/reports/core/summary.json +5 -19
  81. package/testeranto.config.ts +39 -39
  82. package/tsc.log +78 -92
  83. package/testeranto/bundles/node/allTests/metafile.json +0 -486
  84. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +0 -1182
  85. package/testeranto/bundles/node/core/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +0 -1182
  86. package/testeranto/bundles/node/staticSite/metafile.json +0 -593
  87. package/testeranto/bundles/node/staticSite/src/ReportServer.test.ts/index.mjs +0 -1594
  88. package/testeranto/bundles/pure/allTests/metafile.json +0 -626
  89. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +0 -1094
  90. package/testeranto/bundles/pure/core/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +0 -1094
  91. package/testeranto/bundles/pure/staticSite/metafile.json +0 -8
  92. package/testeranto/bundles/web/allTests/metafile.json +0 -780
  93. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +0 -19
  94. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +0 -1092
  95. package/testeranto/bundles/web/core/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +0 -1092
  96. package/testeranto/bundles/web/staticSite/metafile.json +0 -8
  97. package/testeranto/reports/allTests/config.json +0 -40
  98. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/bdd_errors.txt +0 -1
  99. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -2
  100. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -33
  101. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +0 -2
  102. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +0 -26
  103. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-0/butThen/hello.txt +0 -1
  104. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +0 -69
  105. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +0 -74
  106. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -2
  107. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +0 -2
  108. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +0 -26
  109. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +0 -74
  110. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +0 -1
  111. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -2
  112. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -63
  113. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +0 -2
  114. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +0 -26
  115. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-0/butThen/hello.txt +0 -1
  116. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +0 -69
  117. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +0 -74
  118. package/testeranto/reports/allTests/summary.json +0 -23
  119. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/bdd_errors.txt +0 -1
  120. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -2
  121. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -32
  122. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +0 -2
  123. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +0 -26
  124. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/suite-0/given-testInitialization/then-0/butThen/hello.txt +0 -1
  125. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +0 -69
  126. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +0 -74
  127. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -2
  128. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +0 -2
  129. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +0 -26
  130. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +0 -74
  131. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +0 -1
  132. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -2
  133. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -61
  134. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +0 -2
  135. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +0 -26
  136. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/suite-0/given-testInitialization/then-0/butThen/hello.txt +0 -1
  137. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +0 -69
  138. package/testeranto/reports/core/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +0 -74
  139. package/testeranto/reports/staticSite/config.json +0 -24
  140. package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/lint_errors.txt +0 -5
  141. package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/logs.txt +0 -44
  142. package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/message.txt +0 -2
  143. package/testeranto/reports/staticSite/src/ReportServer.test.ts/index/node/prompt.txt +0 -23
  144. package/testeranto/reports/staticSite/summary.json +0 -9
  145. package/testeranto/reportsnode_build_errors +0 -17
@@ -1,1594 +0,0 @@
1
- import { createRequire } from 'module';const require = createRequire(import.meta.url);
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined")
12
- return require.apply(this, arguments);
13
- throw new Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __commonJS = (cb, mod) => function __require2() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
- // If the importer is in node compatibility mode or this is not an ESM
28
- // file that has been converted to a CommonJS file using a Babel-
29
- // compatible transform (i.e. "__esModule" has not been set), then set
30
- // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
- mod
33
- ));
34
-
35
- // node_modules/mime/types.json
36
- var require_types = __commonJS({
37
- "node_modules/mime/types.json"(exports, module) {
38
- module.exports = { "application/andrew-inset": ["ez"], "application/applixware": ["aw"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomsvc+xml": ["atomsvc"], "application/bdoc": ["bdoc"], "application/ccxml+xml": ["ccxml"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cu-seeme": ["cu"], "application/dash+xml": ["mpd"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/font-tdpfr": ["pfr"], "application/font-woff": [], "application/font-woff2": [], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["js", "mjs"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["mp4s", "m4p"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-signature": ["asc", "sig"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/prs.cww": ["cww"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["xfdf"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": [], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": [], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": [], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": [], "application/x-msdownload": ["com", "bat"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["wmf", "emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": [], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "application/xaml+xml": ["xaml"], "application/xcap-diff+xml": ["xdf"], "application/xenc+xml": ["xenc"], "application/xhtml+xml": ["xhtml", "xht"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": [], "audio/adpcm": ["adp"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mp3": [], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/wav": ["wav"], "audio/wave": [], "audio/webm": ["weba"], "audio/x-aac": ["aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": [], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": [], "audio/x-wav": [], "audio/xm": ["xm"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/apng": ["apng"], "image/bmp": ["bmp"], "image/cgm": ["cgm"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/ief": ["ief"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jpm": ["jpm"], "image/jpx": ["jpx", "jpf"], "image/ktx": ["ktx"], "image/png": ["png"], "image/prs.btif": ["btif"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/tiff": ["tiff", "tif"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": [], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/webp": ["webp"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": [], "image/x-pcx": ["pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/rfc822": ["eml", "mime"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/mesh": ["msh", "mesh", "silo"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.vtu": ["vtu"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["x3db", "x3dbz"], "model/x3d+vrml": ["x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/hjson": ["hjson"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["markdown", "md"], "text/mathml": ["mml"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/prs.lines.tag": ["dsc"], "text/richtext": ["rtx"], "text/rtf": [], "text/sgml": ["sgml", "sgm"], "text/slim": ["slim", "slm"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/vtt": ["vtt"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": [], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "text/xml": [], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/jpeg": ["jpgv"], "video/jpm": ["jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/webm": ["webm"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
39
- }
40
- });
41
-
42
- // node_modules/mime/mime.js
43
- var require_mime = __commonJS({
44
- "node_modules/mime/mime.js"(exports, module) {
45
- var path3 = __require("path");
46
- var fs3 = __require("fs");
47
- function Mime() {
48
- this.types = /* @__PURE__ */ Object.create(null);
49
- this.extensions = /* @__PURE__ */ Object.create(null);
50
- }
51
- Mime.prototype.define = function(map) {
52
- for (var type in map) {
53
- var exts = map[type];
54
- for (var i = 0; i < exts.length; i++) {
55
- if (process.env.DEBUG_MIME && this.types[exts[i]]) {
56
- console.warn((this._loading || "define()").replace(/.*\//, ""), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + " to " + type);
57
- }
58
- this.types[exts[i]] = type;
59
- }
60
- if (!this.extensions[type]) {
61
- this.extensions[type] = exts[0];
62
- }
63
- }
64
- };
65
- Mime.prototype.load = function(file) {
66
- this._loading = file;
67
- var map = {}, content = fs3.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
68
- lines.forEach(function(line) {
69
- var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
70
- map[fields.shift()] = fields;
71
- });
72
- this.define(map);
73
- this._loading = null;
74
- };
75
- Mime.prototype.lookup = function(path4, fallback) {
76
- var ext = path4.replace(/^.*[\.\/\\]/, "").toLowerCase();
77
- return this.types[ext] || fallback || this.default_type;
78
- };
79
- Mime.prototype.extension = function(mimeType) {
80
- var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
81
- return this.extensions[type];
82
- };
83
- var mime = new Mime();
84
- mime.define(require_types());
85
- mime.default_type = mime.lookup("bin");
86
- mime.Mime = Mime;
87
- mime.charsets = {
88
- lookup: function(mimeType, fallback) {
89
- return /^text\/|^application\/(javascript|json)/.test(mimeType) ? "UTF-8" : fallback;
90
- }
91
- };
92
- module.exports = mime;
93
- }
94
- });
95
-
96
- // node_modules/node-static/lib/node-static/util.js
97
- var require_util = __commonJS({
98
- "node_modules/node-static/lib/node-static/util.js"(exports) {
99
- var fs3 = __require("fs");
100
- var path3 = __require("path");
101
- exports.mstat = function(dir, files, callback) {
102
- (function mstat(files2, stats) {
103
- var file = files2.shift();
104
- if (file) {
105
- fs3.stat(path3.join(dir, file), function(e, stat) {
106
- if (e) {
107
- callback(e);
108
- } else {
109
- mstat(files2, stats.concat([stat]));
110
- }
111
- });
112
- } else {
113
- callback(null, {
114
- size: stats.reduce(function(total, stat) {
115
- return total + stat.size;
116
- }, 0),
117
- mtime: stats.reduce(function(latest, stat) {
118
- return latest > stat.mtime ? latest : stat.mtime;
119
- }, 0),
120
- ino: stats.reduce(function(total, stat) {
121
- return total + stat.ino;
122
- }, 0)
123
- });
124
- }
125
- })(files.slice(0), []);
126
- };
127
- }
128
- });
129
-
130
- // node_modules/node-static/lib/node-static.js
131
- var require_node_static = __commonJS({
132
- "node_modules/node-static/lib/node-static.js"(exports) {
133
- var fs3 = __require("fs");
134
- var events = __require("events");
135
- var buffer = __require("buffer");
136
- var http2 = __require("http");
137
- var url = __require("url");
138
- var path3 = __require("path");
139
- var mime = require_mime();
140
- var util = require_util();
141
- var version = [0, 7, 9];
142
- var Server = function(root, options) {
143
- if (root && typeof root === "object") {
144
- options = root;
145
- root = null;
146
- }
147
- this.root = path3.normalize(path3.resolve(root || "."));
148
- this.options = options || {};
149
- this.cache = 3600;
150
- this.defaultHeaders = {};
151
- this.options.headers = this.options.headers || {};
152
- this.options.indexFile = this.options.indexFile || "index.html";
153
- if ("cache" in this.options) {
154
- if (typeof this.options.cache === "number") {
155
- this.cache = this.options.cache;
156
- } else if (!this.options.cache) {
157
- this.cache = false;
158
- }
159
- }
160
- if ("serverInfo" in this.options) {
161
- this.serverInfo = this.options.serverInfo.toString();
162
- } else {
163
- this.serverInfo = "node-static/" + version.join(".");
164
- }
165
- this.defaultHeaders["server"] = this.serverInfo;
166
- if (this.cache !== false) {
167
- this.defaultHeaders["cache-control"] = "max-age=" + this.cache;
168
- }
169
- for (var k in this.defaultHeaders) {
170
- this.options.headers[k] = this.options.headers[k] || this.defaultHeaders[k];
171
- }
172
- };
173
- Server.prototype.serveDir = function(pathname, req, res, finish) {
174
- var htmlIndex = path3.join(pathname, this.options.indexFile), that = this;
175
- fs3.stat(htmlIndex, function(e, stat) {
176
- if (!e) {
177
- var status = 200;
178
- var headers = {};
179
- var originalPathname = decodeURI(url.parse(req.url).pathname);
180
- if (originalPathname.length && originalPathname.charAt(originalPathname.length - 1) !== "/") {
181
- return finish(301, { "Location": originalPathname + "/" });
182
- } else {
183
- that.respond(null, status, headers, [htmlIndex], stat, req, res, finish);
184
- }
185
- } else {
186
- fs3.readFile(path3.join(pathname, "index.json"), function(e2, contents) {
187
- if (e2) {
188
- return finish(404, {});
189
- }
190
- var index = JSON.parse(contents);
191
- streamFiles(index.files);
192
- });
193
- }
194
- });
195
- function streamFiles(files) {
196
- util.mstat(pathname, files, function(e, stat) {
197
- if (e) {
198
- return finish(404, {});
199
- }
200
- that.respond(pathname, 200, {}, files, stat, req, res, finish);
201
- });
202
- }
203
- };
204
- Server.prototype.serveFile = function(pathname, status, headers, req, res) {
205
- var that = this;
206
- var promise = new events.EventEmitter();
207
- pathname = this.resolve(pathname);
208
- fs3.stat(pathname, function(e, stat) {
209
- if (e) {
210
- return promise.emit("error", e);
211
- }
212
- that.respond(null, status, headers, [pathname], stat, req, res, function(status2, headers2) {
213
- that.finish(status2, headers2, req, res, promise);
214
- });
215
- });
216
- return promise;
217
- };
218
- Server.prototype.finish = function(status, headers, req, res, promise, callback) {
219
- var result = {
220
- status,
221
- headers,
222
- message: http2.STATUS_CODES[status]
223
- };
224
- headers["server"] = this.serverInfo;
225
- if (!status || status >= 400) {
226
- if (callback) {
227
- callback(result);
228
- } else {
229
- if (promise.listeners("error").length > 0) {
230
- promise.emit("error", result);
231
- } else {
232
- res.writeHead(status, headers);
233
- res.end();
234
- }
235
- }
236
- } else {
237
- if (status !== 200 || req.method !== "GET") {
238
- res.writeHead(status, headers);
239
- res.end();
240
- }
241
- callback && callback(null, result);
242
- promise.emit("success", result);
243
- }
244
- };
245
- Server.prototype.servePath = function(pathname, status, headers, req, res, finish) {
246
- var that = this, promise = new events.EventEmitter();
247
- pathname = this.resolve(pathname);
248
- if (pathname.indexOf(that.root) === 0) {
249
- fs3.stat(pathname, function(e, stat) {
250
- if (e) {
251
- finish(404, {});
252
- } else if (stat.isFile()) {
253
- that.respond(null, status, headers, [pathname], stat, req, res, finish);
254
- } else if (stat.isDirectory()) {
255
- that.serveDir(pathname, req, res, finish);
256
- } else {
257
- finish(400, {});
258
- }
259
- });
260
- } else {
261
- finish(403, {});
262
- }
263
- return promise;
264
- };
265
- Server.prototype.resolve = function(pathname) {
266
- return path3.resolve(path3.join(this.root, pathname));
267
- };
268
- Server.prototype.serve = function(req, res, callback) {
269
- var that = this, promise = new events.EventEmitter(), pathname;
270
- var finish = function(status, headers) {
271
- that.finish(status, headers, req, res, promise, callback);
272
- };
273
- try {
274
- pathname = decodeURI(url.parse(req.url).pathname);
275
- } catch (e) {
276
- return process.nextTick(function() {
277
- return finish(400, {});
278
- });
279
- }
280
- process.nextTick(function() {
281
- that.servePath(pathname, 200, {}, req, res, finish).on("success", function(result) {
282
- promise.emit("success", result);
283
- }).on("error", function(err) {
284
- promise.emit("error");
285
- });
286
- });
287
- if (!callback) {
288
- return promise;
289
- }
290
- };
291
- Server.prototype.gzipOk = function(req, contentType) {
292
- var enable = this.options.gzip;
293
- if (enable && (typeof enable === "boolean" || contentType && enable instanceof RegExp && enable.test(contentType))) {
294
- var acceptEncoding = req.headers["accept-encoding"];
295
- return acceptEncoding && acceptEncoding.indexOf("gzip") >= 0;
296
- }
297
- return false;
298
- };
299
- Server.prototype.respondGzip = function(pathname, status, contentType, _headers, files, stat, req, res, finish) {
300
- var that = this;
301
- if (files.length == 1 && this.gzipOk(req, contentType)) {
302
- var gzFile = files[0] + ".gz";
303
- fs3.stat(gzFile, function(e, gzStat) {
304
- if (!e && gzStat.isFile()) {
305
- var vary = _headers["Vary"];
306
- _headers["Vary"] = (vary && vary != "Accept-Encoding" ? vary + ", " : "") + "Accept-Encoding";
307
- _headers["Content-Encoding"] = "gzip";
308
- stat.size = gzStat.size;
309
- files = [gzFile];
310
- }
311
- that.respondNoGzip(pathname, status, contentType, _headers, files, stat, req, res, finish);
312
- });
313
- } else {
314
- that.respondNoGzip(pathname, status, contentType, _headers, files, stat, req, res, finish);
315
- }
316
- };
317
- Server.prototype.parseByteRange = function(req, stat) {
318
- var byteRange = {
319
- from: 0,
320
- to: 0,
321
- valid: false
322
- };
323
- var rangeHeader = req.headers["range"];
324
- var flavor = "bytes=";
325
- if (rangeHeader) {
326
- if (rangeHeader.indexOf(flavor) == 0 && rangeHeader.indexOf(",") == -1) {
327
- rangeHeader = rangeHeader.substr(flavor.length).split("-");
328
- byteRange.from = parseInt(rangeHeader[0]);
329
- byteRange.to = parseInt(rangeHeader[1]);
330
- if (isNaN(byteRange.from) && !isNaN(byteRange.to)) {
331
- byteRange.from = stat.size - byteRange.to;
332
- byteRange.to = stat.size ? stat.size - 1 : 0;
333
- } else if (!isNaN(byteRange.from) && isNaN(byteRange.to)) {
334
- byteRange.to = stat.size ? stat.size - 1 : 0;
335
- }
336
- if (!isNaN(byteRange.from) && !!byteRange.to && 0 <= byteRange.from && byteRange.from < byteRange.to) {
337
- byteRange.valid = true;
338
- } else {
339
- console.warn("Request contains invalid range header: ", rangeHeader);
340
- }
341
- } else {
342
- console.warn("Request contains unsupported range header: ", rangeHeader);
343
- }
344
- }
345
- return byteRange;
346
- };
347
- Server.prototype.respondNoGzip = function(pathname, status, contentType, _headers, files, stat, req, res, finish) {
348
- var mtime = Date.parse(stat.mtime), key = pathname || files[0], headers = {}, clientETag = req.headers["if-none-match"], clientMTime = Date.parse(req.headers["if-modified-since"]), startByte = 0, length = stat.size, byteRange = this.parseByteRange(req, stat);
349
- if (files.length == 1 && byteRange.valid) {
350
- if (byteRange.to < length) {
351
- startByte = byteRange.from;
352
- length = byteRange.to - byteRange.from + 1;
353
- status = 206;
354
- headers["Content-Range"] = "bytes " + byteRange.from + "-" + byteRange.to + "/" + stat.size;
355
- } else {
356
- byteRange.valid = false;
357
- console.warn("Range request exceeds file boundaries, goes until byte no", byteRange.to, "against file size of", length, "bytes");
358
- }
359
- }
360
- if (!byteRange.valid && req.headers["range"]) {
361
- console.error(new Error("Range request present but invalid, might serve whole file instead"));
362
- }
363
- for (var k in this.options.headers) {
364
- headers[k] = this.options.headers[k];
365
- }
366
- for (var k in _headers) {
367
- headers[k] = _headers[k];
368
- }
369
- headers["Etag"] = JSON.stringify([stat.ino, stat.size, mtime].join("-"));
370
- headers["Date"] = (/* @__PURE__ */ new Date()).toUTCString();
371
- headers["Last-Modified"] = new Date(stat.mtime).toUTCString();
372
- headers["Content-Type"] = contentType;
373
- headers["Content-Length"] = length;
374
- for (var k in _headers) {
375
- headers[k] = _headers[k];
376
- }
377
- if ((clientMTime || clientETag) && (!clientETag || clientETag === headers["Etag"]) && (!clientMTime || clientMTime >= mtime)) {
378
- [
379
- "Content-Encoding",
380
- "Content-Language",
381
- "Content-Length",
382
- "Content-Location",
383
- "Content-MD5",
384
- "Content-Range",
385
- "Content-Type",
386
- "Expires",
387
- "Last-Modified"
388
- ].forEach(function(entityHeader) {
389
- delete headers[entityHeader];
390
- });
391
- finish(304, headers);
392
- } else {
393
- res.writeHead(status, headers);
394
- this.stream(key, files, length, startByte, res, function(e) {
395
- if (e) {
396
- return finish(500, {});
397
- }
398
- finish(status, headers);
399
- });
400
- }
401
- };
402
- Server.prototype.respond = function(pathname, status, _headers, files, stat, req, res, finish) {
403
- var contentType = _headers["Content-Type"] || mime.lookup(files[0]) || "application/octet-stream";
404
- if (this.options.gzip) {
405
- this.respondGzip(pathname, status, contentType, _headers, files, stat, req, res, finish);
406
- } else {
407
- this.respondNoGzip(pathname, status, contentType, _headers, files, stat, req, res, finish);
408
- }
409
- };
410
- Server.prototype.stream = function(pathname, files, length, startByte, res, callback) {
411
- (function streamFile(files2, offset) {
412
- var file = files2.shift();
413
- if (file) {
414
- file = path3.resolve(file) === path3.normalize(file) ? file : path3.join(pathname || ".", file);
415
- fs3.createReadStream(file, {
416
- flags: "r",
417
- mode: 438,
418
- start: startByte,
419
- end: startByte + (length ? length - 1 : 0)
420
- }).on("data", function(chunk) {
421
- if (chunk.length && offset < length && offset >= 0) {
422
- offset += chunk.length;
423
- }
424
- }).on("close", function() {
425
- streamFile(files2, offset);
426
- }).on("error", function(err) {
427
- callback(err);
428
- console.error(err);
429
- }).pipe(res, { end: false });
430
- } else {
431
- res.end();
432
- callback(null, offset);
433
- }
434
- })(files.slice(0), 0);
435
- };
436
- exports.Server = Server;
437
- exports.version = version;
438
- exports.mime = mime;
439
- }
440
- });
441
-
442
- // src/lib/index.ts
443
- var BaseAdapter = () => ({
444
- beforeAll: async (s) => s,
445
- beforeEach: async function(subject, initialValues, x, testResource, pm) {
446
- return subject;
447
- },
448
- afterEach: async (s) => s,
449
- afterAll: (store) => void 0,
450
- butThen: async (store, thenCb) => {
451
- return thenCb(store);
452
- },
453
- andWhen: async (store, whenCB, testResource, pm) => {
454
- try {
455
- await whenCB(store, testResource, pm);
456
- } catch (error) {
457
- console.error("Error in andWhen:", error);
458
- throw error;
459
- }
460
- },
461
- assertThis: (x) => x
462
- });
463
- var DefaultAdapter = (p) => {
464
- return {
465
- ...BaseAdapter,
466
- ...p
467
- };
468
- };
469
- var defaultTestResourceRequirement = {
470
- ports: 0
471
- };
472
-
473
- // src/lib/pmProxy.ts
474
- var baseProxy = function(pm, mappings) {
475
- return new Proxy(pm, {
476
- get: (target, prop, receiver) => {
477
- for (const mapping of mappings) {
478
- const method = mapping[0];
479
- const arger = mapping[1];
480
- if (prop === method) {
481
- return (...x) => target[prop](arger(...x));
482
- }
483
- }
484
- return (...x) => target[prop](...x);
485
- }
486
- });
487
- };
488
- var butThenProxy = (pm, filepath) => {
489
- return baseProxy(pm, [
490
- [
491
- "screencast",
492
- (opts, p) => {
493
- const path3 = `${filepath}/butThen/${opts.path}`;
494
- pm.currentStep?.artifacts?.push(path3);
495
- return [
496
- {
497
- ...opts,
498
- path: path3
499
- },
500
- p
501
- ];
502
- }
503
- ],
504
- [
505
- "createWriteStream",
506
- (fp) => {
507
- const path3 = `${filepath}/butThen/${fp}`;
508
- pm.currentStep?.artifacts?.push(path3);
509
- return [path3];
510
- }
511
- ],
512
- [
513
- "writeFileSync",
514
- (fp, contents) => {
515
- const path3 = `${filepath}/butThen/${fp}`;
516
- pm.currentStep?.artifacts?.push(path3);
517
- return [path3, contents];
518
- }
519
- ],
520
- [
521
- "customScreenShot",
522
- (opts, p) => {
523
- const path3 = `${filepath}/butThen/${opts.path}`;
524
- pm.currentStep?.artifacts?.push(path3);
525
- return [
526
- {
527
- ...opts,
528
- path: path3
529
- },
530
- p
531
- ];
532
- }
533
- ]
534
- ]);
535
- };
536
- var andWhenProxy = (pm, filepath) => baseProxy(pm, [
537
- [
538
- "screencast",
539
- (opts, p) => [
540
- {
541
- ...opts,
542
- path: `${filepath}/andWhen/${opts.path}`
543
- },
544
- p
545
- ]
546
- ],
547
- ["createWriteStream", (fp) => [`${filepath}/andWhen/${fp}`]],
548
- ["writeFileSync", (fp, contents) => [`${filepath}/andWhen${fp}`, contents]],
549
- [
550
- "customScreenShot",
551
- (opts, p) => [
552
- {
553
- ...opts,
554
- path: `${filepath}/andWhen${opts.path}`
555
- },
556
- p
557
- ]
558
- ]
559
- ]);
560
- var afterEachProxy = (pm, suite, given) => baseProxy(pm, [
561
- [
562
- "screencast",
563
- (opts, p) => [
564
- {
565
- ...opts,
566
- path: `suite-${suite}/given-${given}/afterEach/${opts.path}`
567
- },
568
- p
569
- ]
570
- ],
571
- ["createWriteStream", (fp) => [`suite-${suite}/afterEach/${fp}`]],
572
- [
573
- "writeFileSync",
574
- (fp, contents) => [
575
- `suite-${suite}/given-${given}/afterEach/${fp}`,
576
- contents
577
- ]
578
- ],
579
- [
580
- "customScreenShot",
581
- (opts, p) => [
582
- {
583
- ...opts,
584
- path: `suite-${suite}/given-${given}/afterEach/${opts.path}`
585
- },
586
- p
587
- ]
588
- ]
589
- ]);
590
- var beforeEachProxy = (pm, suite) => baseProxy(pm, [
591
- [
592
- "screencast",
593
- (opts, p) => [
594
- {
595
- ...opts,
596
- path: `suite-${suite}/beforeEach/${opts.path}`
597
- },
598
- p
599
- ]
600
- ],
601
- [
602
- "writeFileSync",
603
- (fp, contents) => [`suite-${suite}/beforeEach/${fp}`, contents]
604
- ],
605
- [
606
- "customScreenShot",
607
- (opts, p) => [
608
- {
609
- ...opts,
610
- path: `suite-${suite}/beforeEach/${opts.path}`
611
- },
612
- p
613
- ]
614
- ],
615
- ["createWriteStream", (fp) => [`suite-${suite}/beforeEach/${fp}`]]
616
- ]);
617
- var beforeAllProxy = (pm, suite) => baseProxy(pm, [
618
- [
619
- "writeFileSync",
620
- (fp, contents) => [`suite-${suite}/beforeAll/${fp}`, contents]
621
- ],
622
- [
623
- "customScreenShot",
624
- (opts, p) => [
625
- {
626
- ...opts,
627
- path: `suite-${suite}/beforeAll/${opts.path}`
628
- },
629
- p
630
- ]
631
- ],
632
- ["createWriteStream", (fp) => [`suite-${suite}/beforeAll/${fp}`]]
633
- ]);
634
- var afterAllProxy = (pm, suite) => baseProxy(pm, [
635
- ["createWriteStream", (fp) => [`suite-${suite}/afterAll/${fp}`]],
636
- [
637
- "writeFileSync",
638
- (fp, contents) => [`suite-${suite}/afterAll/${fp}`, contents]
639
- ],
640
- [
641
- "customScreenShot",
642
- (opts, p) => [
643
- {
644
- ...opts,
645
- path: `suite-${suite}/afterAll/${opts.path}`
646
- },
647
- p
648
- ]
649
- ]
650
- ]);
651
-
652
- // src/lib/abstractBase.ts
653
- var BaseGiven = class {
654
- constructor(name, features, whens, thens, givenCB, initialValues) {
655
- this.artifacts = [];
656
- this.name = name;
657
- this.features = features;
658
- this.whens = whens;
659
- this.thens = thens;
660
- this.givenCB = givenCB;
661
- this.initialValues = initialValues;
662
- }
663
- addArtifact(path3) {
664
- console.log(`[Artifact] Adding to ${this.constructor.name}:`, path3);
665
- this.artifacts.push(path3);
666
- }
667
- beforeAll(store) {
668
- return store;
669
- }
670
- toObj() {
671
- return {
672
- key: this.key,
673
- name: this.name,
674
- whens: this.whens.map((w) => {
675
- if (w && w.toObj)
676
- return w.toObj();
677
- console.error("w is not as expected!", w.toString());
678
- return {};
679
- }),
680
- thens: this.thens.map((t) => t.toObj()),
681
- error: this.error ? [this.error, this.error.stack] : null,
682
- failed: this.failed,
683
- features: this.features,
684
- artifacts: this.artifacts
685
- };
686
- }
687
- async afterEach(store, key, artifactory, pm) {
688
- return store;
689
- }
690
- async give(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm, suiteNdx) {
691
- this.key = key;
692
- tLog(`
693
- ${this.key}`);
694
- tLog(`
695
- Given: ${this.name}`);
696
- const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
697
- this.uberCatcher((e) => {
698
- console.error(e.toString());
699
- this.error = e.error;
700
- tLog(e.stack);
701
- });
702
- try {
703
- const proxiedPm = beforeEachProxy(pm, suiteNdx.toString());
704
- console.log(`[Given] Setting currentStep for beforeEach:`, this.name);
705
- proxiedPm.currentStep = this;
706
- this.store = await this.givenThat(
707
- subject,
708
- testResourceConfiguration,
709
- givenArtifactory,
710
- this.givenCB,
711
- this.initialValues,
712
- proxiedPm
713
- );
714
- } catch (e) {
715
- console.error("Given failure: ", e.toString());
716
- this.error = e;
717
- throw e;
718
- }
719
- try {
720
- for (const [whenNdx, whenStep] of this.whens.entries()) {
721
- await whenStep.test(
722
- this.store,
723
- testResourceConfiguration,
724
- tLog,
725
- pm,
726
- `suite-${suiteNdx}/given-${key}/when/${whenNdx}`
727
- );
728
- }
729
- for (const [thenNdx, thenStep] of this.thens.entries()) {
730
- const t = await thenStep.test(
731
- this.store,
732
- testResourceConfiguration,
733
- tLog,
734
- pm,
735
- `suite-${suiteNdx}/given-${key}/then-${thenNdx}`
736
- );
737
- tester(t);
738
- }
739
- } catch (e) {
740
- this.failed = true;
741
- tLog(e.stack);
742
- throw e;
743
- } finally {
744
- try {
745
- await this.afterEach(
746
- this.store,
747
- this.key,
748
- givenArtifactory,
749
- afterEachProxy(pm, suiteNdx.toString(), key)
750
- );
751
- } catch (e) {
752
- console.error("afterEach failed!", e.toString());
753
- this.failed = e;
754
- throw e;
755
- }
756
- }
757
- return this.store;
758
- }
759
- };
760
- var BaseWhen = class {
761
- constructor(name, whenCB) {
762
- this.artifacts = [];
763
- this.name = name;
764
- this.whenCB = whenCB;
765
- }
766
- toObj() {
767
- console.log("toObj error", this.error);
768
- if (this.error) {
769
- return {
770
- name: this.name,
771
- error: this.error && this.error.name + this.error.stack,
772
- artifacts: this.artifacts
773
- };
774
- } else {
775
- return {
776
- name: this.name,
777
- artifacts: this.artifacts
778
- };
779
- }
780
- }
781
- async test(store, testResourceConfiguration, tLog, pm, filepath) {
782
- try {
783
- tLog(" When:", this.name);
784
- console.debug("[DEBUG] Executing When step:", this.name.toString());
785
- const proxiedPm = andWhenProxy(pm, filepath);
786
- console.log(`[When] Setting currentStep for andWhen:`, this.name);
787
- proxiedPm.currentStep = this;
788
- const result = await this.andWhen(
789
- store,
790
- this.whenCB,
791
- testResourceConfiguration,
792
- proxiedPm
793
- );
794
- console.debug("[DEBUG] When step completed:", this.name.toString());
795
- return result;
796
- } catch (e) {
797
- console.error(
798
- "[ERROR] When step failed:",
799
- this.name.toString(),
800
- e.toString()
801
- );
802
- this.error = e;
803
- throw e;
804
- }
805
- }
806
- };
807
- var BaseThen = class {
808
- constructor(name, thenCB) {
809
- this.artifacts = [];
810
- this.name = name;
811
- this.thenCB = thenCB;
812
- this.error = false;
813
- }
814
- toObj() {
815
- return {
816
- name: this.name,
817
- error: this.error,
818
- artifacts: this.artifacts
819
- };
820
- }
821
- async test(store, testResourceConfiguration, tLog, pm, filepath) {
822
- const proxiedPm = butThenProxy(pm, filepath);
823
- console.log(`[Then] Setting currentStep for butThen:`, this.name);
824
- proxiedPm.currentStep = this;
825
- return this.butThen(
826
- store,
827
- async (s) => {
828
- if (typeof this.thenCB === "function") {
829
- return await this.thenCB(s, proxiedPm);
830
- } else {
831
- return this.thenCB;
832
- }
833
- },
834
- testResourceConfiguration,
835
- butThenProxy(pm, filepath)
836
- ).catch((e) => {
837
- this.error = e.toString();
838
- });
839
- }
840
- };
841
-
842
- // src/lib/basebuilder.ts
843
- var BaseBuilder = class {
844
- constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, testResourceRequirement, testSpecification) {
845
- this.artifacts = [];
846
- this.artifacts = [];
847
- this.testResourceRequirement = testResourceRequirement;
848
- this.suitesOverrides = suitesOverrides;
849
- this.givenOverides = givenOverides;
850
- this.whenOverides = whenOverides;
851
- this.thenOverides = thenOverides;
852
- this.testSpecification = testSpecification;
853
- this.specs = testSpecification(
854
- this.Suites(),
855
- this.Given(),
856
- this.When(),
857
- this.Then()
858
- );
859
- this.testJobs = this.specs.map((suite) => {
860
- const suiteRunner = (suite2) => async (puppetMaster, tLog) => {
861
- const x = await suite2.run(
862
- input,
863
- puppetMaster.testResourceConfiguration,
864
- (fPath, value) => puppetMaster.testArtiFactoryfileWriter(
865
- tLog,
866
- (p) => {
867
- this.artifacts.push(p);
868
- }
869
- )(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value),
870
- tLog,
871
- puppetMaster
872
- );
873
- return x;
874
- };
875
- const runner = suiteRunner(suite);
876
- return {
877
- test: suite,
878
- toObj: () => {
879
- return suite.toObj();
880
- },
881
- runner,
882
- receiveTestResourceConfig: async function(puppetMaster) {
883
- const tLog = async (...l) => {
884
- };
885
- const suiteDone = await runner(puppetMaster, tLog);
886
- const fails = suiteDone.fails;
887
- await puppetMaster.writeFileSync([
888
- `bdd_errors.txt`,
889
- fails.toString()
890
- ]);
891
- await puppetMaster.writeFileSync([
892
- `tests.json`,
893
- JSON.stringify(this.toObj(), null, 2)
894
- ]);
895
- return {
896
- failed: fails > 0,
897
- fails,
898
- artifacts: this.artifacts || [],
899
- // logPromise,
900
- features: suiteDone.features()
901
- };
902
- }
903
- };
904
- });
905
- }
906
- // testsJson() {
907
- // puppetMaster.writeFileSync(
908
- // `tests.json`,
909
- // JSON.stringify({ features: suiteDone.features() }, null, 2)
910
- // );
911
- // }
912
- Specs() {
913
- return this.specs;
914
- }
915
- Suites() {
916
- return this.suitesOverrides;
917
- }
918
- Given() {
919
- return this.givenOverides;
920
- }
921
- When() {
922
- return this.whenOverides;
923
- }
924
- Then() {
925
- return this.thenOverides;
926
- }
927
- };
928
-
929
- // src/lib/classBuilder.ts
930
- var ClassBuilder = class extends BaseBuilder {
931
- constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, testResourceRequirement) {
932
- const classySuites = Object.entries(testImplementation.suites).reduce(
933
- (a, [key], index) => {
934
- a[key] = (somestring, givens) => {
935
- return new suiteKlasser.prototype.constructor(
936
- somestring,
937
- index,
938
- givens
939
- );
940
- };
941
- return a;
942
- },
943
- {}
944
- );
945
- const classyGivens = Object.entries(testImplementation.givens).reduce(
946
- (a, [key, g]) => {
947
- a[key] = (features, whens, thens, ...initialValues) => {
948
- return new givenKlasser.prototype.constructor(
949
- key,
950
- features,
951
- whens,
952
- thens,
953
- testImplementation.givens[key],
954
- initialValues
955
- );
956
- };
957
- return a;
958
- },
959
- {}
960
- );
961
- const classyWhens = Object.entries(testImplementation.whens).reduce(
962
- (a, [key, whEn]) => {
963
- a[key] = (...payload) => {
964
- return new whenKlasser.prototype.constructor(
965
- `${whEn.name}: ${payload && payload.toString()}`,
966
- whEn(...payload)
967
- );
968
- };
969
- return a;
970
- },
971
- {}
972
- );
973
- const classyThens = Object.entries(
974
- testImplementation.thens
975
- ).reduce(
976
- (a, [key, thEn]) => {
977
- a[key] = (expected, ...x) => {
978
- return new thenKlasser.prototype.constructor(
979
- `${thEn.name}: ${expected && expected.toString()}`,
980
- thEn(expected, ...x)
981
- );
982
- };
983
- return a;
984
- },
985
- {}
986
- );
987
- super(
988
- input,
989
- classySuites,
990
- classyGivens,
991
- classyWhens,
992
- classyThens,
993
- testResourceRequirement,
994
- testSpecification
995
- );
996
- }
997
- };
998
-
999
- // src/lib/BaseSuite.ts
1000
- var BaseSuite = class {
1001
- constructor(name, index, givens = {}) {
1002
- const suiteName = name || "testSuite";
1003
- if (!suiteName) {
1004
- throw new Error("BaseSuite requires a non-empty name");
1005
- }
1006
- console.log(
1007
- "[DEBUG] BaseSuite constructor - name:",
1008
- suiteName,
1009
- "index:",
1010
- index
1011
- );
1012
- this.name = suiteName;
1013
- this.index = index;
1014
- this.givens = givens;
1015
- this.fails = 0;
1016
- console.log("[DEBUG] BaseSuite initialized:", this.name, this.index);
1017
- console.log("[DEBUG] BaseSuite givens:", Object.keys(givens).toString());
1018
- }
1019
- features() {
1020
- try {
1021
- const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
1022
- return array.indexOf(value) === index;
1023
- });
1024
- console.debug("[DEBUG] Features extracted:", features.toString());
1025
- return features || [];
1026
- } catch (e) {
1027
- console.error("[ERROR] Failed to extract features:", e);
1028
- return [];
1029
- }
1030
- }
1031
- toObj() {
1032
- const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
1033
- return {
1034
- name: this.name,
1035
- givens,
1036
- fails: this.fails,
1037
- failed: this.failed,
1038
- features: this.features()
1039
- };
1040
- }
1041
- setup(s, artifactory, tr, pm) {
1042
- return new Promise((res) => res(s));
1043
- }
1044
- assertThat(t) {
1045
- return !!t;
1046
- }
1047
- afterAll(store, artifactory, pm) {
1048
- return store;
1049
- }
1050
- async run(input, testResourceConfiguration, artifactory, tLog, pm) {
1051
- this.testResourceConfiguration = testResourceConfiguration;
1052
- const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
1053
- tLog("\nSuite:", this.index, this.name);
1054
- const sNdx = this.index;
1055
- const subject = await this.setup(
1056
- input,
1057
- suiteArtifactory,
1058
- testResourceConfiguration,
1059
- beforeAllProxy(pm, sNdx.toString())
1060
- );
1061
- for (const [gKey, g] of Object.entries(this.givens)) {
1062
- const giver = this.givens[gKey];
1063
- this.store = await giver.give(
1064
- subject,
1065
- gKey,
1066
- testResourceConfiguration,
1067
- this.assertThat,
1068
- suiteArtifactory,
1069
- tLog,
1070
- pm,
1071
- sNdx
1072
- ).catch((e) => {
1073
- this.failed = true;
1074
- this.fails = this.fails + 1;
1075
- throw e;
1076
- });
1077
- }
1078
- try {
1079
- this.afterAll(
1080
- this.store,
1081
- artifactory,
1082
- afterAllProxy(pm, sNdx.toString())
1083
- );
1084
- } catch (e) {
1085
- console.error(e);
1086
- }
1087
- return this;
1088
- }
1089
- };
1090
-
1091
- // src/lib/core.ts
1092
- var TesterantoCore = class extends ClassBuilder {
1093
- constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter, uberCatcher) {
1094
- const fullAdapter = DefaultAdapter(testAdapter);
1095
- super(
1096
- testImplementation,
1097
- testSpecification,
1098
- input,
1099
- class extends BaseSuite {
1100
- afterAll(store, artifactory, pm) {
1101
- return fullAdapter.afterAll(store, pm);
1102
- }
1103
- assertThat(t) {
1104
- return fullAdapter.assertThis(t);
1105
- }
1106
- async setup(s, artifactory, tr, pm) {
1107
- return (fullAdapter.beforeAll || (async (input2, artifactory2, tr2, pm2) => input2))(
1108
- s,
1109
- this.testResourceConfiguration,
1110
- // artifactory,
1111
- pm
1112
- );
1113
- }
1114
- },
1115
- class Given extends BaseGiven {
1116
- constructor() {
1117
- super(...arguments);
1118
- this.uberCatcher = uberCatcher;
1119
- }
1120
- async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
1121
- return fullAdapter.beforeEach(
1122
- subject,
1123
- initializer,
1124
- testResource,
1125
- initialValues,
1126
- pm
1127
- );
1128
- }
1129
- afterEach(store, key, artifactory, pm) {
1130
- return new Promise(
1131
- (res) => res(fullAdapter.afterEach(store, key, pm))
1132
- );
1133
- }
1134
- },
1135
- class When extends BaseWhen {
1136
- async andWhen(store, whenCB, testResource, pm) {
1137
- return await fullAdapter.andWhen(store, whenCB, testResource, pm);
1138
- }
1139
- },
1140
- class Then extends BaseThen {
1141
- async butThen(store, thenCB, testResource, pm) {
1142
- return await fullAdapter.butThen(store, thenCB, testResource, pm);
1143
- }
1144
- },
1145
- testResourceRequirement
1146
- );
1147
- }
1148
- };
1149
-
1150
- // src/PM/node.ts
1151
- import net from "net";
1152
- import fs from "fs";
1153
- import path from "path";
1154
-
1155
- // src/PM/index.ts
1156
- var PM = class {
1157
- };
1158
-
1159
- // src/PM/node.ts
1160
- var fPaths = [];
1161
- var PM_Node = class extends PM {
1162
- constructor(t, ipcFile) {
1163
- super();
1164
- this.testResourceConfiguration = t;
1165
- this.client = net.createConnection(ipcFile, () => {
1166
- return;
1167
- });
1168
- }
1169
- start() {
1170
- throw new Error("DEPRECATED");
1171
- }
1172
- stop() {
1173
- throw new Error("stop not implemented.");
1174
- }
1175
- send(command, ...argz) {
1176
- const key = Math.random().toString();
1177
- if (!this.client) {
1178
- console.error(
1179
- `Tried to send "${command} (${argz})" but the test has not been started and the IPC client is not established. Exiting as failure!`
1180
- );
1181
- process.exit(-1);
1182
- }
1183
- return new Promise((res) => {
1184
- const myListener = (event) => {
1185
- const x = JSON.parse(event);
1186
- if (x.key === key) {
1187
- process.removeListener("message", myListener);
1188
- res(x.payload);
1189
- }
1190
- };
1191
- process.addListener("message", myListener);
1192
- this.client.write(JSON.stringify([command, ...argz, key]));
1193
- });
1194
- }
1195
- async launchSideCar(n) {
1196
- return this.send(
1197
- "launchSideCar",
1198
- n,
1199
- this.testResourceConfiguration.name
1200
- );
1201
- }
1202
- stopSideCar(n) {
1203
- return this.send(
1204
- "stopSideCar",
1205
- n,
1206
- this.testResourceConfiguration.name
1207
- );
1208
- }
1209
- async pages() {
1210
- return this.send("pages", ...arguments);
1211
- }
1212
- waitForSelector(p, s) {
1213
- return this.send("waitForSelector", ...arguments);
1214
- }
1215
- closePage(p) {
1216
- return this.send("closePage", ...arguments);
1217
- }
1218
- goto(page, url) {
1219
- return this.send("goto", ...arguments);
1220
- }
1221
- async newPage() {
1222
- return this.send("newPage");
1223
- }
1224
- $(selector, page) {
1225
- return this.send("$", ...arguments);
1226
- }
1227
- isDisabled(selector) {
1228
- return this.send("isDisabled", ...arguments);
1229
- }
1230
- getAttribute(selector, attribute, p) {
1231
- return this.send("getAttribute", ...arguments);
1232
- }
1233
- getInnerHtml(selector, p) {
1234
- return this.send("getInnerHtml", ...arguments);
1235
- }
1236
- // setValue(selector: string) {
1237
- // return this.send("getValue", ...arguments);
1238
- // }
1239
- focusOn(selector) {
1240
- return this.send("focusOn", ...arguments);
1241
- }
1242
- typeInto(selector) {
1243
- return this.send("typeInto", ...arguments);
1244
- }
1245
- page() {
1246
- return this.send("page");
1247
- }
1248
- click(selector) {
1249
- return this.send("click", ...arguments);
1250
- }
1251
- screencast(opts, page) {
1252
- return this.send(
1253
- "screencast",
1254
- {
1255
- ...opts,
1256
- path: this.testResourceConfiguration.fs + "/" + opts.path
1257
- },
1258
- page,
1259
- this.testResourceConfiguration.name
1260
- );
1261
- }
1262
- screencastStop(p) {
1263
- return this.send("screencastStop", ...arguments);
1264
- }
1265
- customScreenShot(x, y) {
1266
- const opts = x[0];
1267
- const page = x[1];
1268
- return this.send(
1269
- "customScreenShot",
1270
- {
1271
- ...opts,
1272
- path: this.testResourceConfiguration.fs + "/" + opts.path
1273
- },
1274
- this.testResourceConfiguration.name,
1275
- page
1276
- );
1277
- }
1278
- async existsSync(destFolder) {
1279
- return await this.send(
1280
- "existsSync",
1281
- this.testResourceConfiguration.fs + "/" + destFolder
1282
- );
1283
- }
1284
- mkdirSync() {
1285
- return this.send("mkdirSync", this.testResourceConfiguration.fs + "/");
1286
- }
1287
- async write(uid, contents) {
1288
- return await this.send("write", ...arguments);
1289
- }
1290
- async writeFileSync([filepath, contents]) {
1291
- return await this.send(
1292
- "writeFileSync",
1293
- this.testResourceConfiguration.fs + "/" + filepath,
1294
- contents,
1295
- this.testResourceConfiguration.name
1296
- );
1297
- }
1298
- async createWriteStream(filepath) {
1299
- return await this.send(
1300
- "createWriteStream",
1301
- this.testResourceConfiguration.fs + "/" + filepath,
1302
- this.testResourceConfiguration.name
1303
- );
1304
- }
1305
- async end(uid) {
1306
- return await this.send("end", ...arguments);
1307
- }
1308
- async customclose() {
1309
- return await this.send(
1310
- "customclose",
1311
- this.testResourceConfiguration.fs,
1312
- this.testResourceConfiguration.name
1313
- );
1314
- }
1315
- testArtiFactoryfileWriter(tLog, callback) {
1316
- return (fPath, value) => {
1317
- callback(
1318
- new Promise((res, rej) => {
1319
- tLog("testArtiFactory =>", fPath);
1320
- const cleanPath = path.resolve(fPath);
1321
- fPaths.push(cleanPath.replace(process.cwd(), ``));
1322
- const targetDir = cleanPath.split("/").slice(0, -1).join("/");
1323
- fs.mkdir(targetDir, { recursive: true }, async (error) => {
1324
- if (error) {
1325
- console.error(`\u2757\uFE0FtestArtiFactory failed`, targetDir, error);
1326
- }
1327
- if (Buffer.isBuffer(value)) {
1328
- fs.writeFileSync(fPath, value, "binary");
1329
- res();
1330
- } else if (`string` === typeof value) {
1331
- fs.writeFileSync(fPath, value.toString(), {
1332
- encoding: "utf-8"
1333
- });
1334
- res();
1335
- } else {
1336
- const pipeStream = value;
1337
- const myFile = fs.createWriteStream(fPath);
1338
- pipeStream.pipe(myFile);
1339
- pipeStream.on("close", () => {
1340
- myFile.close();
1341
- res();
1342
- });
1343
- }
1344
- });
1345
- })
1346
- );
1347
- };
1348
- }
1349
- // launch(options?: PuppeteerLaunchOptions): Promise<Browser>;
1350
- startPuppeteer(options) {
1351
- }
1352
- };
1353
-
1354
- // src/Node.ts
1355
- var ipcfile;
1356
- var NodeTesteranto = class extends TesterantoCore {
1357
- constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter) {
1358
- super(
1359
- input,
1360
- testSpecification,
1361
- testImplementation,
1362
- testResourceRequirement,
1363
- testAdapter,
1364
- () => {
1365
- }
1366
- );
1367
- }
1368
- async receiveTestResourceConfig(partialTestResource) {
1369
- console.log("receiveTestResourceConfig", partialTestResource);
1370
- const t = JSON.parse(partialTestResource);
1371
- const pm = new PM_Node(t, ipcfile);
1372
- return await this.testJobs[0].receiveTestResourceConfig(pm);
1373
- }
1374
- };
1375
- var testeranto = async (input, testSpecification, testImplementation, testAdapter, testResourceRequirement = defaultTestResourceRequirement) => {
1376
- try {
1377
- const t = new NodeTesteranto(
1378
- input,
1379
- testSpecification,
1380
- testImplementation,
1381
- testResourceRequirement,
1382
- testAdapter
1383
- );
1384
- process.on("unhandledRejection", (reason, promise) => {
1385
- console.error("Unhandled Rejection at:", promise, "reason:", reason);
1386
- });
1387
- ipcfile = process.argv[3];
1388
- const f = await t.receiveTestResourceConfig(process.argv[2]);
1389
- console.error("goodbye node with failures", f.fails);
1390
- process.exit(f.fails);
1391
- } catch (e) {
1392
- console.error("goodbye node with caught error", e);
1393
- process.exit(-1);
1394
- }
1395
- };
1396
- var Node_default = testeranto;
1397
-
1398
- // src/ReportServerLib.ts
1399
- var import_node_static = __toESM(require_node_static(), 1);
1400
- import http from "http";
1401
- import path2 from "path";
1402
- import fs2 from "fs";
1403
- var fileServer = new import_node_static.default.Server("./", {
1404
- cache: false,
1405
- headers: {
1406
- "Cache-Control": "no-cache, no-store, must-revalidate",
1407
- Pragma: "no-cache",
1408
- Expires: "0"
1409
- }
1410
- });
1411
- var server = http.createServer((req, res) => {
1412
- let responded = false;
1413
- const safeResponse = (handler) => {
1414
- if (responded)
1415
- return;
1416
- responded = true;
1417
- try {
1418
- handler();
1419
- } catch (err) {
1420
- console.error("Error handling request:", err);
1421
- if (!res.headersSent) {
1422
- res.writeHead(500);
1423
- }
1424
- res.end("Internal Server Error");
1425
- }
1426
- };
1427
- req.on("error", (err) => {
1428
- console.error("Request error:", err);
1429
- safeResponse(() => {
1430
- if (!res.headersSent) {
1431
- res.writeHead(400);
1432
- }
1433
- res.end("Bad Request");
1434
- });
1435
- });
1436
- req.on("end", () => {
1437
- safeResponse(() => {
1438
- const filePath = path2.join(process.cwd(), req.url || "");
1439
- fs2.stat(filePath, (err, stats) => {
1440
- if (err || !stats.isFile()) {
1441
- fs2.stat(filePath, (dirErr, dirStats) => {
1442
- if (!dirErr && dirStats.isDirectory()) {
1443
- fs2.readdir(filePath, (readErr, files) => {
1444
- if (readErr) {
1445
- res.writeHead(500);
1446
- return res.end("Error reading directory");
1447
- }
1448
- res.writeHead(200, { "Content-Type": "text/html" });
1449
- res.write(`
1450
- <html>
1451
- <head>
1452
- <title>Directory Listing: ${req.url}</title>
1453
- <style>
1454
- body { font-family: sans-serif; margin: 2rem; }
1455
- h1 { color: #333; }
1456
- ul { list-style: none; padding: 0; }
1457
- li { padding: 0.5rem; }
1458
- li a { color: #0366d6; text-decoration: none; }
1459
- li a:hover { text-decoration: underline; }
1460
- </style>
1461
- </head>
1462
- <body>
1463
- <h1>Directory: ${req.url}</h1>
1464
- <ul>
1465
- ${files.map(
1466
- (file) => `
1467
- <li>
1468
- <a href="${path2.join(req.url || "", file)}">
1469
- ${file}${file.endsWith("/") ? "/" : ""}
1470
- </a>
1471
- </li>
1472
- `
1473
- ).join("")}
1474
- </ul>
1475
- </body>
1476
- </html>
1477
- `);
1478
- res.end();
1479
- });
1480
- } else {
1481
- if (!res.headersSent) {
1482
- res.writeHead(404, { "Content-Type": "text/plain" });
1483
- res.end("File not found");
1484
- }
1485
- }
1486
- });
1487
- return;
1488
- }
1489
- const serve = () => {
1490
- fileServer.serve(req, res, (err2) => {
1491
- if (err2 && !res.headersSent) {
1492
- res.writeHead(err2.status || 500);
1493
- res.end(err2.message);
1494
- }
1495
- });
1496
- };
1497
- if (!res.headersSent) {
1498
- serve();
1499
- }
1500
- });
1501
- });
1502
- });
1503
- req.resume();
1504
- });
1505
- server.on("error", (err) => {
1506
- console.error("Server error:", err);
1507
- });
1508
- process.on("uncaughtException", (err) => {
1509
- console.error("Uncaught exception:", err);
1510
- });
1511
- var start = (port) => server.listen(port, () => {
1512
- console.log(`Server running on http://localhost:${port}`);
1513
- console.log("Serving files from:", process.cwd());
1514
- });
1515
- var ReportServerOfPort = (port) => start(port);
1516
-
1517
- // src/ReportServer.test.ts/index.ts
1518
- var specification = (Suite, Given, When, Then) => [
1519
- Suite.Default("the http server which is used in development", {
1520
- initialization: Given["the http server which is used in development"](
1521
- ["It should serve the front page", "It should serve the ReportApp"],
1522
- [],
1523
- [
1524
- Then["the frontpage looks good"]()
1525
- // Then["the projects page looks good"](),
1526
- // Then["a project page looks good"](),
1527
- // Then["a test page looks good"](),
1528
- ]
1529
- )
1530
- })
1531
- ];
1532
- var implementation = {
1533
- suites: {
1534
- Default: "the http server which is used in development"
1535
- },
1536
- givens: {
1537
- "the http server which is used in development": function(subject) {
1538
- return subject;
1539
- }
1540
- },
1541
- // There are no "whens", it is a stateless server.
1542
- whens: {},
1543
- thens: {
1544
- "the frontpage looks good": async (port, utils) => {
1545
- debugger;
1546
- const page = await utils.newPage();
1547
- utils.goto(page, `localhost:${port}`);
1548
- utils.customScreenShot({ path: `frontpage.png` }, page);
1549
- return;
1550
- },
1551
- "the projects page looks good": function() {
1552
- throw new Error("Function not implemented.");
1553
- },
1554
- "a project page looks good": function() {
1555
- throw new Error("Function not implemented.");
1556
- },
1557
- "a test page looks good": function() {
1558
- throw new Error("Function not implemented.");
1559
- }
1560
- }
1561
- };
1562
- var adapter = {
1563
- assertThis: function(x) {
1564
- throw new Error("Function not implemented.");
1565
- },
1566
- andWhen: function(store, whenCB, testResource, pm) {
1567
- throw new Error("Function not implemented.");
1568
- },
1569
- butThen: function(store, thenCB, testResource, pm) {
1570
- throw new Error("Function not implemented.");
1571
- },
1572
- afterAll: function(store, pm) {
1573
- throw new Error("Function not implemented.");
1574
- },
1575
- afterEach: function(store, key, pm) {
1576
- throw new Error("Function not implemented.");
1577
- },
1578
- beforeAll: async function(input, testResource, pm) {
1579
- await new Promise((res, rej) => input(testResource.ports[0]));
1580
- return testResource.ports[0];
1581
- },
1582
- beforeEach: function(subject, initializer, testResource, initialValues, pm) {
1583
- throw new Error("Function not implemented.");
1584
- }
1585
- };
1586
- var ReportServer_test_default = Node_default(
1587
- ReportServerOfPort,
1588
- specification,
1589
- implementation,
1590
- adapter
1591
- );
1592
- export {
1593
- ReportServer_test_default as default
1594
- };