@stablyai/internal-playwright 0.1.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 (297) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +168 -0
  4. package/ThirdPartyNotices.txt +6277 -0
  5. package/cli.js +19 -0
  6. package/index.d.ts +17 -0
  7. package/index.js +17 -0
  8. package/index.mjs +18 -0
  9. package/jsx-runtime.js +42 -0
  10. package/jsx-runtime.mjs +21 -0
  11. package/lib/agents/generateAgents.js +265 -0
  12. package/lib/agents/generator.md +102 -0
  13. package/lib/agents/healer.md +78 -0
  14. package/lib/agents/planner.md +135 -0
  15. package/lib/cli.js +274 -0
  16. package/lib/common/config.js +274 -0
  17. package/lib/common/config.js.map +7 -0
  18. package/lib/common/configLoader.js +377 -0
  19. package/lib/common/configLoader.js.map +7 -0
  20. package/lib/common/esmLoaderHost.js +102 -0
  21. package/lib/common/esmLoaderHost.js.map +7 -0
  22. package/lib/common/expectBundle.js +52 -0
  23. package/lib/common/expectBundle.js.map +7 -0
  24. package/lib/common/expectBundleImpl.js +389 -0
  25. package/lib/common/expectBundleImpl.js.map +7 -0
  26. package/lib/common/fixtures.js +302 -0
  27. package/lib/common/fixtures.js.map +7 -0
  28. package/lib/common/globals.js +58 -0
  29. package/lib/common/globals.js.map +7 -0
  30. package/lib/common/ipc.js +60 -0
  31. package/lib/common/ipc.js.map +7 -0
  32. package/lib/common/poolBuilder.js +85 -0
  33. package/lib/common/poolBuilder.js.map +7 -0
  34. package/lib/common/process.js +104 -0
  35. package/lib/common/process.js.map +7 -0
  36. package/lib/common/suiteUtils.js +140 -0
  37. package/lib/common/suiteUtils.js.map +7 -0
  38. package/lib/common/test.js +321 -0
  39. package/lib/common/test.js.map +7 -0
  40. package/lib/common/testLoader.js +100 -0
  41. package/lib/common/testLoader.js.map +7 -0
  42. package/lib/common/testType.js +310 -0
  43. package/lib/common/testType.js.map +7 -0
  44. package/lib/fsWatcher.js +67 -0
  45. package/lib/fsWatcher.js.map +7 -0
  46. package/lib/index.js +696 -0
  47. package/lib/index.js.map +7 -0
  48. package/lib/internalsForTest.js +42 -0
  49. package/lib/internalsForTest.js.map +7 -0
  50. package/lib/isomorphic/events.js +77 -0
  51. package/lib/isomorphic/events.js.map +7 -0
  52. package/lib/isomorphic/folders.js +30 -0
  53. package/lib/isomorphic/folders.js.map +7 -0
  54. package/lib/isomorphic/stringInternPool.js +69 -0
  55. package/lib/isomorphic/stringInternPool.js.map +7 -0
  56. package/lib/isomorphic/teleReceiver.js +507 -0
  57. package/lib/isomorphic/teleReceiver.js.map +7 -0
  58. package/lib/isomorphic/teleSuiteUpdater.js +137 -0
  59. package/lib/isomorphic/teleSuiteUpdater.js.map +7 -0
  60. package/lib/isomorphic/testServerConnection.js +211 -0
  61. package/lib/isomorphic/testServerConnection.js.map +7 -0
  62. package/lib/isomorphic/testServerInterface.js +16 -0
  63. package/lib/isomorphic/testServerInterface.js.map +7 -0
  64. package/lib/isomorphic/testTree.js +334 -0
  65. package/lib/isomorphic/testTree.js.map +7 -0
  66. package/lib/isomorphic/types.d.js +16 -0
  67. package/lib/isomorphic/types.d.js.map +7 -0
  68. package/lib/loader/loaderMain.js +59 -0
  69. package/lib/loader/loaderMain.js.map +7 -0
  70. package/lib/matchers/expect.js +325 -0
  71. package/lib/matchers/expect.js.map +7 -0
  72. package/lib/matchers/matcherHint.js +87 -0
  73. package/lib/matchers/matcherHint.js.map +7 -0
  74. package/lib/matchers/matchers.js +366 -0
  75. package/lib/matchers/matchers.js.map +7 -0
  76. package/lib/matchers/toBeTruthy.js +73 -0
  77. package/lib/matchers/toBeTruthy.js.map +7 -0
  78. package/lib/matchers/toEqual.js +99 -0
  79. package/lib/matchers/toEqual.js.map +7 -0
  80. package/lib/matchers/toHaveURL.js +102 -0
  81. package/lib/matchers/toHaveURL.js.map +7 -0
  82. package/lib/matchers/toMatchAriaSnapshot.js +159 -0
  83. package/lib/matchers/toMatchAriaSnapshot.js.map +7 -0
  84. package/lib/matchers/toMatchSnapshot.js +359 -0
  85. package/lib/matchers/toMatchSnapshot.js.map +7 -0
  86. package/lib/matchers/toMatchText.js +99 -0
  87. package/lib/matchers/toMatchText.js.map +7 -0
  88. package/lib/mcp/browser/actions.d.js +16 -0
  89. package/lib/mcp/browser/backend.js +93 -0
  90. package/lib/mcp/browser/backend.js.map +7 -0
  91. package/lib/mcp/browser/browserContextFactory.js +296 -0
  92. package/lib/mcp/browser/browserServerBackend.js +76 -0
  93. package/lib/mcp/browser/codegen.js +66 -0
  94. package/lib/mcp/browser/config.js +385 -0
  95. package/lib/mcp/browser/context.js +287 -0
  96. package/lib/mcp/browser/response.js +228 -0
  97. package/lib/mcp/browser/sessionLog.js +160 -0
  98. package/lib/mcp/browser/tab.js +277 -0
  99. package/lib/mcp/browser/tool.js +30 -0
  100. package/lib/mcp/browser/tool.js.map +7 -0
  101. package/lib/mcp/browser/tools/common.js +63 -0
  102. package/lib/mcp/browser/tools/console.js +44 -0
  103. package/lib/mcp/browser/tools/dialogs.js +60 -0
  104. package/lib/mcp/browser/tools/evaluate.js +70 -0
  105. package/lib/mcp/browser/tools/files.js +58 -0
  106. package/lib/mcp/browser/tools/form.js +74 -0
  107. package/lib/mcp/browser/tools/install.js +69 -0
  108. package/lib/mcp/browser/tools/keyboard.js +85 -0
  109. package/lib/mcp/browser/tools/mouse.js +107 -0
  110. package/lib/mcp/browser/tools/navigate.js +62 -0
  111. package/lib/mcp/browser/tools/network.js +54 -0
  112. package/lib/mcp/browser/tools/pdf.js +59 -0
  113. package/lib/mcp/browser/tools/screenshot.js +88 -0
  114. package/lib/mcp/browser/tools/snapshot.js +182 -0
  115. package/lib/mcp/browser/tools/tabs.js +67 -0
  116. package/lib/mcp/browser/tools/tool.js +49 -0
  117. package/lib/mcp/browser/tools/tracing.js +74 -0
  118. package/lib/mcp/browser/tools/utils.js +100 -0
  119. package/lib/mcp/browser/tools/verify.js +154 -0
  120. package/lib/mcp/browser/tools/wait.js +63 -0
  121. package/lib/mcp/browser/tools.js +80 -0
  122. package/lib/mcp/browser/tools.js.map +7 -0
  123. package/lib/mcp/browser/watchdog.js +44 -0
  124. package/lib/mcp/config.d.js +16 -0
  125. package/lib/mcp/extension/cdpRelay.js +351 -0
  126. package/lib/mcp/extension/extensionContextFactory.js +75 -0
  127. package/lib/mcp/extension/protocol.js +28 -0
  128. package/lib/mcp/index.js +61 -0
  129. package/lib/mcp/log.js +35 -0
  130. package/lib/mcp/program.js +96 -0
  131. package/lib/mcp/sdk/bundle.js +81 -0
  132. package/lib/mcp/sdk/bundle.js.map +7 -0
  133. package/lib/mcp/sdk/call.js +49 -0
  134. package/lib/mcp/sdk/call.js.map +7 -0
  135. package/lib/mcp/sdk/exports.js +32 -0
  136. package/lib/mcp/sdk/exports.js.map +7 -0
  137. package/lib/mcp/sdk/http.js +187 -0
  138. package/lib/mcp/sdk/http.js.map +7 -0
  139. package/lib/mcp/sdk/inProcessTransport.js +71 -0
  140. package/lib/mcp/sdk/inProcessTransport.js.map +7 -0
  141. package/lib/mcp/sdk/mdb.js +206 -0
  142. package/lib/mcp/sdk/mdb.js.map +7 -0
  143. package/lib/mcp/sdk/proxyBackend.js +128 -0
  144. package/lib/mcp/sdk/proxyBackend.js.map +7 -0
  145. package/lib/mcp/sdk/server.js +189 -0
  146. package/lib/mcp/sdk/server.js.map +7 -0
  147. package/lib/mcp/sdk/tool.js +51 -0
  148. package/lib/mcp/sdk/tool.js.map +7 -0
  149. package/lib/mcp/test/backend.js +67 -0
  150. package/lib/mcp/test/backend.js.map +7 -0
  151. package/lib/mcp/test/browserBackend.js +98 -0
  152. package/lib/mcp/test/context.js +48 -0
  153. package/lib/mcp/test/context.js.map +7 -0
  154. package/lib/mcp/test/generatorTools.js +122 -0
  155. package/lib/mcp/test/plannerTools.js +46 -0
  156. package/lib/mcp/test/seed.js +72 -0
  157. package/lib/mcp/test/streams.js +39 -0
  158. package/lib/mcp/test/streams.js.map +7 -0
  159. package/lib/mcp/test/testBackend.js +97 -0
  160. package/lib/mcp/test/testContext.js +176 -0
  161. package/lib/mcp/test/testTool.js +30 -0
  162. package/lib/mcp/test/testTools.js +115 -0
  163. package/lib/mcp/test/tool.js +30 -0
  164. package/lib/mcp/test/tool.js.map +7 -0
  165. package/lib/mcp/test/tools.js +150 -0
  166. package/lib/mcp/test/tools.js.map +7 -0
  167. package/lib/mcp/vscode/host.js +187 -0
  168. package/lib/mcp/vscode/main.js +77 -0
  169. package/lib/mcpBundleImpl.js +41 -0
  170. package/lib/mcpBundleImpl.js.map +7 -0
  171. package/lib/plugins/gitCommitInfoPlugin.js +198 -0
  172. package/lib/plugins/gitCommitInfoPlugin.js.map +7 -0
  173. package/lib/plugins/index.js +28 -0
  174. package/lib/plugins/index.js.map +7 -0
  175. package/lib/plugins/webServerPlugin.js +209 -0
  176. package/lib/plugins/webServerPlugin.js.map +7 -0
  177. package/lib/program.js +412 -0
  178. package/lib/program.js.map +7 -0
  179. package/lib/reporters/base.js +609 -0
  180. package/lib/reporters/base.js.map +7 -0
  181. package/lib/reporters/blob.js +135 -0
  182. package/lib/reporters/blob.js.map +7 -0
  183. package/lib/reporters/dot.js +82 -0
  184. package/lib/reporters/dot.js.map +7 -0
  185. package/lib/reporters/empty.js +32 -0
  186. package/lib/reporters/empty.js.map +7 -0
  187. package/lib/reporters/github.js +128 -0
  188. package/lib/reporters/github.js.map +7 -0
  189. package/lib/reporters/html.js +644 -0
  190. package/lib/reporters/html.js.map +7 -0
  191. package/lib/reporters/internalReporter.js +130 -0
  192. package/lib/reporters/internalReporter.js.map +7 -0
  193. package/lib/reporters/json.js +254 -0
  194. package/lib/reporters/json.js.map +7 -0
  195. package/lib/reporters/junit.js +230 -0
  196. package/lib/reporters/junit.js.map +7 -0
  197. package/lib/reporters/line.js +113 -0
  198. package/lib/reporters/line.js.map +7 -0
  199. package/lib/reporters/list.js +235 -0
  200. package/lib/reporters/list.js.map +7 -0
  201. package/lib/reporters/listModeReporter.js +69 -0
  202. package/lib/reporters/listModeReporter.js.map +7 -0
  203. package/lib/reporters/markdown.js +144 -0
  204. package/lib/reporters/markdown.js.map +7 -0
  205. package/lib/reporters/merge.js +535 -0
  206. package/lib/reporters/merge.js.map +7 -0
  207. package/lib/reporters/multiplexer.js +104 -0
  208. package/lib/reporters/multiplexer.js.map +7 -0
  209. package/lib/reporters/reporterV2.js +102 -0
  210. package/lib/reporters/reporterV2.js.map +7 -0
  211. package/lib/reporters/teleEmitter.js +297 -0
  212. package/lib/reporters/teleEmitter.js.map +7 -0
  213. package/lib/reporters/versions/blobV1.js +16 -0
  214. package/lib/reporters/versions/blobV1.js.map +7 -0
  215. package/lib/runner/dispatcher.js +491 -0
  216. package/lib/runner/dispatcher.js.map +7 -0
  217. package/lib/runner/failureTracker.js +72 -0
  218. package/lib/runner/failureTracker.js.map +7 -0
  219. package/lib/runner/lastRun.js +77 -0
  220. package/lib/runner/lastRun.js.map +7 -0
  221. package/lib/runner/loadUtils.js +333 -0
  222. package/lib/runner/loadUtils.js.map +7 -0
  223. package/lib/runner/loaderHost.js +89 -0
  224. package/lib/runner/loaderHost.js.map +7 -0
  225. package/lib/runner/processHost.js +161 -0
  226. package/lib/runner/processHost.js.map +7 -0
  227. package/lib/runner/projectUtils.js +241 -0
  228. package/lib/runner/projectUtils.js.map +7 -0
  229. package/lib/runner/rebase.js +189 -0
  230. package/lib/runner/rebase.js.map +7 -0
  231. package/lib/runner/reporters.js +137 -0
  232. package/lib/runner/reporters.js.map +7 -0
  233. package/lib/runner/runner.js +173 -0
  234. package/lib/runner/sigIntWatcher.js +96 -0
  235. package/lib/runner/sigIntWatcher.js.map +7 -0
  236. package/lib/runner/taskRunner.js +127 -0
  237. package/lib/runner/taskRunner.js.map +7 -0
  238. package/lib/runner/tasks.js +410 -0
  239. package/lib/runner/tasks.js.map +7 -0
  240. package/lib/runner/testGroups.js +117 -0
  241. package/lib/runner/testGroups.js.map +7 -0
  242. package/lib/runner/testRunner.js +390 -0
  243. package/lib/runner/testRunner.js.map +7 -0
  244. package/lib/runner/testServer.js +264 -0
  245. package/lib/runner/testServer.js.map +7 -0
  246. package/lib/runner/uiMode.js +271 -0
  247. package/lib/runner/uiModeReporter.js +30 -0
  248. package/lib/runner/uiModeReporter.js.map +7 -0
  249. package/lib/runner/vcs.js +72 -0
  250. package/lib/runner/vcs.js.map +7 -0
  251. package/lib/runner/watchMode.js +395 -0
  252. package/lib/runner/watchMode.js.map +7 -0
  253. package/lib/runner/workerHost.js +95 -0
  254. package/lib/runner/workerHost.js.map +7 -0
  255. package/lib/store.js +98 -0
  256. package/lib/third_party/pirates.js +62 -0
  257. package/lib/third_party/pirates.js.map +7 -0
  258. package/lib/third_party/tsconfig-loader.js +103 -0
  259. package/lib/third_party/tsconfig-loader.js.map +7 -0
  260. package/lib/transform/babelBundle.js +43 -0
  261. package/lib/transform/babelBundle.js.map +7 -0
  262. package/lib/transform/babelBundleImpl.js +461 -0
  263. package/lib/transform/babelBundleImpl.js.map +7 -0
  264. package/lib/transform/compilationCache.js +272 -0
  265. package/lib/transform/compilationCache.js.map +7 -0
  266. package/lib/transform/esmLoader.js +104 -0
  267. package/lib/transform/esmLoader.js.map +7 -0
  268. package/lib/transform/esmUtils.js +32 -0
  269. package/lib/transform/portTransport.js +67 -0
  270. package/lib/transform/portTransport.js.map +7 -0
  271. package/lib/transform/transform.js +293 -0
  272. package/lib/transform/transform.js.map +7 -0
  273. package/lib/util.js +403 -0
  274. package/lib/util.js.map +7 -0
  275. package/lib/utilsBundle.js +43 -0
  276. package/lib/utilsBundle.js.map +7 -0
  277. package/lib/utilsBundleImpl.js +100 -0
  278. package/lib/utilsBundleImpl.js.map +7 -0
  279. package/lib/worker/fixtureRunner.js +258 -0
  280. package/lib/worker/fixtureRunner.js.map +7 -0
  281. package/lib/worker/stepContext.js +34 -0
  282. package/lib/worker/testInfo.js +508 -0
  283. package/lib/worker/testInfo.js.map +7 -0
  284. package/lib/worker/testTracing.js +344 -0
  285. package/lib/worker/testTracing.js.map +7 -0
  286. package/lib/worker/timeoutManager.js +174 -0
  287. package/lib/worker/timeoutManager.js.map +7 -0
  288. package/lib/worker/util.js +31 -0
  289. package/lib/worker/util.js.map +7 -0
  290. package/lib/worker/workerMain.js +520 -0
  291. package/lib/worker/workerMain.js.map +7 -0
  292. package/package.json +74 -0
  293. package/test.d.ts +18 -0
  294. package/test.js +24 -0
  295. package/test.mjs +33 -0
  296. package/types/test.d.ts +10217 -0
  297. package/types/testReporter.d.ts +816 -0
@@ -0,0 +1,507 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var teleReceiver_exports = {};
20
+ __export(teleReceiver_exports, {
21
+ TeleReporterReceiver: () => TeleReporterReceiver,
22
+ TeleSuite: () => TeleSuite,
23
+ TeleTestCase: () => TeleTestCase,
24
+ TeleTestResult: () => TeleTestResult,
25
+ baseFullConfig: () => baseFullConfig,
26
+ computeTestCaseOutcome: () => computeTestCaseOutcome,
27
+ parseRegexPatterns: () => parseRegexPatterns,
28
+ serializeRegexPatterns: () => serializeRegexPatterns
29
+ });
30
+ module.exports = __toCommonJS(teleReceiver_exports);
31
+ class TeleReporterReceiver {
32
+ constructor(reporter, options = {}) {
33
+ this.isListing = false;
34
+ this._tests = /* @__PURE__ */ new Map();
35
+ this._rootSuite = new TeleSuite("", "root");
36
+ this._options = options;
37
+ this._reporter = reporter;
38
+ }
39
+ reset() {
40
+ this._rootSuite._entries = [];
41
+ this._tests.clear();
42
+ }
43
+ dispatch(message) {
44
+ const { method, params } = message;
45
+ if (method === "onConfigure") {
46
+ this._onConfigure(params.config);
47
+ return;
48
+ }
49
+ if (method === "onProject") {
50
+ this._onProject(params.project);
51
+ return;
52
+ }
53
+ if (method === "onBegin") {
54
+ this._onBegin();
55
+ return;
56
+ }
57
+ if (method === "onTestBegin") {
58
+ this._onTestBegin(params.testId, params.result);
59
+ return;
60
+ }
61
+ if (method === "onTestEnd") {
62
+ this._onTestEnd(params.test, params.result);
63
+ return;
64
+ }
65
+ if (method === "onStepBegin") {
66
+ this._onStepBegin(params.testId, params.resultId, params.step);
67
+ return;
68
+ }
69
+ if (method === "onAttach") {
70
+ this._onAttach(params.testId, params.resultId, params.attachments);
71
+ return;
72
+ }
73
+ if (method === "onStepEnd") {
74
+ this._onStepEnd(params.testId, params.resultId, params.step);
75
+ return;
76
+ }
77
+ if (method === "onError") {
78
+ this._onError(params.error);
79
+ return;
80
+ }
81
+ if (method === "onStdIO") {
82
+ this._onStdIO(params.type, params.testId, params.resultId, params.data, params.isBase64);
83
+ return;
84
+ }
85
+ if (method === "onEnd")
86
+ return this._onEnd(params.result);
87
+ if (method === "onExit")
88
+ return this._onExit();
89
+ }
90
+ _onConfigure(config) {
91
+ this._rootDir = config.rootDir;
92
+ this._config = this._parseConfig(config);
93
+ this._reporter.onConfigure?.(this._config);
94
+ }
95
+ _onProject(project) {
96
+ let projectSuite = this._options.mergeProjects ? this._rootSuite.suites.find((suite) => suite.project().name === project.name) : void 0;
97
+ if (!projectSuite) {
98
+ projectSuite = new TeleSuite(project.name, "project");
99
+ this._rootSuite._addSuite(projectSuite);
100
+ }
101
+ projectSuite._project = this._parseProject(project);
102
+ for (const suite of project.suites)
103
+ this._mergeSuiteInto(suite, projectSuite);
104
+ }
105
+ _onBegin() {
106
+ this._reporter.onBegin?.(this._rootSuite);
107
+ }
108
+ _onTestBegin(testId, payload) {
109
+ const test = this._tests.get(testId);
110
+ if (this._options.clearPreviousResultsWhenTestBegins)
111
+ test.results = [];
112
+ const testResult = test._createTestResult(payload.id);
113
+ testResult.retry = payload.retry;
114
+ testResult.workerIndex = payload.workerIndex;
115
+ testResult.parallelIndex = payload.parallelIndex;
116
+ testResult.setStartTimeNumber(payload.startTime);
117
+ this._reporter.onTestBegin?.(test, testResult);
118
+ }
119
+ _onTestEnd(testEndPayload, payload) {
120
+ const test = this._tests.get(testEndPayload.testId);
121
+ test.timeout = testEndPayload.timeout;
122
+ test.expectedStatus = testEndPayload.expectedStatus;
123
+ const result = test.results.find((r) => r._id === payload.id);
124
+ result.duration = payload.duration;
125
+ result.status = payload.status;
126
+ result.errors = payload.errors;
127
+ result.error = result.errors?.[0];
128
+ if (!!payload.attachments)
129
+ result.attachments = this._parseAttachments(payload.attachments);
130
+ if (payload.annotations) {
131
+ this._absoluteAnnotationLocationsInplace(payload.annotations);
132
+ result.annotations = payload.annotations;
133
+ test.annotations = payload.annotations;
134
+ }
135
+ this._reporter.onTestEnd?.(test, result);
136
+ result._stepMap = /* @__PURE__ */ new Map();
137
+ }
138
+ _onStepBegin(testId, resultId, payload) {
139
+ const test = this._tests.get(testId);
140
+ const result = test.results.find((r) => r._id === resultId);
141
+ const parentStep = payload.parentStepId ? result._stepMap.get(payload.parentStepId) : void 0;
142
+ const location = this._absoluteLocation(payload.location);
143
+ const step = new TeleTestStep(payload, parentStep, location, result);
144
+ if (parentStep)
145
+ parentStep.steps.push(step);
146
+ else
147
+ result.steps.push(step);
148
+ result._stepMap.set(payload.id, step);
149
+ this._reporter.onStepBegin?.(test, result, step);
150
+ }
151
+ _onStepEnd(testId, resultId, payload) {
152
+ const test = this._tests.get(testId);
153
+ const result = test.results.find((r) => r._id === resultId);
154
+ const step = result._stepMap.get(payload.id);
155
+ step._endPayload = payload;
156
+ step.duration = payload.duration;
157
+ step.error = payload.error;
158
+ this._reporter.onStepEnd?.(test, result, step);
159
+ }
160
+ _onAttach(testId, resultId, attachments) {
161
+ const test = this._tests.get(testId);
162
+ const result = test.results.find((r) => r._id === resultId);
163
+ result.attachments.push(...attachments.map((a) => ({
164
+ name: a.name,
165
+ contentType: a.contentType,
166
+ path: a.path,
167
+ body: a.base64 && globalThis.Buffer ? Buffer.from(a.base64, "base64") : void 0
168
+ })));
169
+ }
170
+ _onError(error) {
171
+ this._reporter.onError?.(error);
172
+ }
173
+ _onStdIO(type, testId, resultId, data, isBase64) {
174
+ const chunk = isBase64 ? globalThis.Buffer ? Buffer.from(data, "base64") : atob(data) : data;
175
+ const test = testId ? this._tests.get(testId) : void 0;
176
+ const result = test && resultId ? test.results.find((r) => r._id === resultId) : void 0;
177
+ if (type === "stdout") {
178
+ result?.stdout.push(chunk);
179
+ this._reporter.onStdOut?.(chunk, test, result);
180
+ } else {
181
+ result?.stderr.push(chunk);
182
+ this._reporter.onStdErr?.(chunk, test, result);
183
+ }
184
+ }
185
+ async _onEnd(result) {
186
+ await this._reporter.onEnd?.({
187
+ status: result.status,
188
+ startTime: new Date(result.startTime),
189
+ duration: result.duration
190
+ });
191
+ }
192
+ _onExit() {
193
+ return this._reporter.onExit?.();
194
+ }
195
+ _parseConfig(config) {
196
+ const result = { ...baseFullConfig, ...config };
197
+ if (this._options.configOverrides) {
198
+ result.configFile = this._options.configOverrides.configFile;
199
+ result.reportSlowTests = this._options.configOverrides.reportSlowTests;
200
+ result.quiet = this._options.configOverrides.quiet;
201
+ result.reporter = [...this._options.configOverrides.reporter];
202
+ }
203
+ return result;
204
+ }
205
+ _parseProject(project) {
206
+ return {
207
+ metadata: project.metadata,
208
+ name: project.name,
209
+ outputDir: this._absolutePath(project.outputDir),
210
+ repeatEach: project.repeatEach,
211
+ retries: project.retries,
212
+ testDir: this._absolutePath(project.testDir),
213
+ testIgnore: parseRegexPatterns(project.testIgnore),
214
+ testMatch: parseRegexPatterns(project.testMatch),
215
+ timeout: project.timeout,
216
+ grep: parseRegexPatterns(project.grep),
217
+ grepInvert: parseRegexPatterns(project.grepInvert),
218
+ dependencies: project.dependencies,
219
+ teardown: project.teardown,
220
+ snapshotDir: this._absolutePath(project.snapshotDir),
221
+ use: project.use
222
+ };
223
+ }
224
+ _parseAttachments(attachments) {
225
+ return attachments.map((a) => {
226
+ return {
227
+ ...a,
228
+ body: a.base64 && globalThis.Buffer ? Buffer.from(a.base64, "base64") : void 0
229
+ };
230
+ });
231
+ }
232
+ _mergeSuiteInto(jsonSuite, parent) {
233
+ let targetSuite = parent.suites.find((s) => s.title === jsonSuite.title);
234
+ if (!targetSuite) {
235
+ targetSuite = new TeleSuite(jsonSuite.title, parent.type === "project" ? "file" : "describe");
236
+ parent._addSuite(targetSuite);
237
+ }
238
+ targetSuite.location = this._absoluteLocation(jsonSuite.location);
239
+ jsonSuite.entries.forEach((e) => {
240
+ if ("testId" in e)
241
+ this._mergeTestInto(e, targetSuite);
242
+ else
243
+ this._mergeSuiteInto(e, targetSuite);
244
+ });
245
+ }
246
+ _mergeTestInto(jsonTest, parent) {
247
+ let targetTest = this._options.mergeTestCases ? parent.tests.find((s) => s.title === jsonTest.title && s.repeatEachIndex === jsonTest.repeatEachIndex) : void 0;
248
+ if (!targetTest) {
249
+ targetTest = new TeleTestCase(jsonTest.testId, jsonTest.title, this._absoluteLocation(jsonTest.location), jsonTest.repeatEachIndex);
250
+ parent._addTest(targetTest);
251
+ this._tests.set(targetTest.id, targetTest);
252
+ }
253
+ this._updateTest(jsonTest, targetTest);
254
+ }
255
+ _updateTest(payload, test) {
256
+ test.id = payload.testId;
257
+ test.location = this._absoluteLocation(payload.location);
258
+ test.retries = payload.retries;
259
+ test.tags = payload.tags ?? [];
260
+ test.annotations = payload.annotations ?? [];
261
+ this._absoluteAnnotationLocationsInplace(test.annotations);
262
+ return test;
263
+ }
264
+ _absoluteAnnotationLocationsInplace(annotations) {
265
+ for (const annotation of annotations) {
266
+ if (annotation.location)
267
+ annotation.location = this._absoluteLocation(annotation.location);
268
+ }
269
+ }
270
+ _absoluteLocation(location) {
271
+ if (!location)
272
+ return location;
273
+ return {
274
+ ...location,
275
+ file: this._absolutePath(location.file)
276
+ };
277
+ }
278
+ _absolutePath(relativePath) {
279
+ if (relativePath === void 0)
280
+ return;
281
+ return this._options.resolvePath ? this._options.resolvePath(this._rootDir, relativePath) : this._rootDir + "/" + relativePath;
282
+ }
283
+ }
284
+ class TeleSuite {
285
+ constructor(title, type) {
286
+ this._entries = [];
287
+ this._requireFile = "";
288
+ this._parallelMode = "none";
289
+ this.title = title;
290
+ this._type = type;
291
+ }
292
+ get type() {
293
+ return this._type;
294
+ }
295
+ get suites() {
296
+ return this._entries.filter((e) => e.type !== "test");
297
+ }
298
+ get tests() {
299
+ return this._entries.filter((e) => e.type === "test");
300
+ }
301
+ entries() {
302
+ return this._entries;
303
+ }
304
+ allTests() {
305
+ const result = [];
306
+ const visit = (suite) => {
307
+ for (const entry of suite.entries()) {
308
+ if (entry.type === "test")
309
+ result.push(entry);
310
+ else
311
+ visit(entry);
312
+ }
313
+ };
314
+ visit(this);
315
+ return result;
316
+ }
317
+ titlePath() {
318
+ const titlePath = this.parent ? this.parent.titlePath() : [];
319
+ if (this.title || this._type !== "describe")
320
+ titlePath.push(this.title);
321
+ return titlePath;
322
+ }
323
+ project() {
324
+ return this._project ?? this.parent?.project();
325
+ }
326
+ _addTest(test) {
327
+ test.parent = this;
328
+ this._entries.push(test);
329
+ }
330
+ _addSuite(suite) {
331
+ suite.parent = this;
332
+ this._entries.push(suite);
333
+ }
334
+ }
335
+ class TeleTestCase {
336
+ constructor(id, title, location, repeatEachIndex) {
337
+ this.fn = () => {
338
+ };
339
+ this.results = [];
340
+ this.type = "test";
341
+ this.expectedStatus = "passed";
342
+ this.timeout = 0;
343
+ this.annotations = [];
344
+ this.retries = 0;
345
+ this.tags = [];
346
+ this.repeatEachIndex = 0;
347
+ this.id = id;
348
+ this.title = title;
349
+ this.location = location;
350
+ this.repeatEachIndex = repeatEachIndex;
351
+ }
352
+ titlePath() {
353
+ const titlePath = this.parent ? this.parent.titlePath() : [];
354
+ titlePath.push(this.title);
355
+ return titlePath;
356
+ }
357
+ outcome() {
358
+ return computeTestCaseOutcome(this);
359
+ }
360
+ ok() {
361
+ const status = this.outcome();
362
+ return status === "expected" || status === "flaky" || status === "skipped";
363
+ }
364
+ _createTestResult(id) {
365
+ const result = new TeleTestResult(this.results.length, id);
366
+ this.results.push(result);
367
+ return result;
368
+ }
369
+ }
370
+ class TeleTestStep {
371
+ constructor(payload, parentStep, location, result) {
372
+ this.duration = -1;
373
+ this.steps = [];
374
+ this._startTime = 0;
375
+ this.title = payload.title;
376
+ this.category = payload.category;
377
+ this.location = location;
378
+ this.parent = parentStep;
379
+ this._startTime = payload.startTime;
380
+ this._result = result;
381
+ }
382
+ titlePath() {
383
+ const parentPath = this.parent?.titlePath() || [];
384
+ return [...parentPath, this.title];
385
+ }
386
+ get startTime() {
387
+ return new Date(this._startTime);
388
+ }
389
+ set startTime(value) {
390
+ this._startTime = +value;
391
+ }
392
+ get attachments() {
393
+ return this._endPayload?.attachments?.map((index) => this._result.attachments[index]) ?? [];
394
+ }
395
+ get annotations() {
396
+ return this._endPayload?.annotations ?? [];
397
+ }
398
+ }
399
+ class TeleTestResult {
400
+ constructor(retry, id) {
401
+ this.parallelIndex = -1;
402
+ this.workerIndex = -1;
403
+ this.duration = -1;
404
+ this.stdout = [];
405
+ this.stderr = [];
406
+ this.attachments = [];
407
+ this.annotations = [];
408
+ this.status = "skipped";
409
+ this.steps = [];
410
+ this.errors = [];
411
+ this._stepMap = /* @__PURE__ */ new Map();
412
+ this._startTime = 0;
413
+ this.retry = retry;
414
+ this._id = id;
415
+ }
416
+ setStartTimeNumber(startTime) {
417
+ this._startTime = startTime;
418
+ }
419
+ get startTime() {
420
+ return new Date(this._startTime);
421
+ }
422
+ set startTime(value) {
423
+ this._startTime = +value;
424
+ }
425
+ }
426
+ const baseFullConfig = {
427
+ forbidOnly: false,
428
+ fullyParallel: false,
429
+ globalSetup: null,
430
+ globalTeardown: null,
431
+ globalTimeout: 0,
432
+ grep: /.*/,
433
+ grepInvert: null,
434
+ maxFailures: 0,
435
+ metadata: {},
436
+ preserveOutput: "always",
437
+ projects: [],
438
+ reporter: [[process.env.CI ? "dot" : "list"]],
439
+ reportSlowTests: {
440
+ max: 5,
441
+ threshold: 3e5
442
+ /* 5 minutes */
443
+ },
444
+ configFile: "",
445
+ rootDir: "",
446
+ quiet: false,
447
+ shard: null,
448
+ updateSnapshots: "missing",
449
+ updateSourceMethod: "patch",
450
+ version: "",
451
+ workers: 0,
452
+ webServer: null
453
+ };
454
+ function serializeRegexPatterns(patterns) {
455
+ if (!Array.isArray(patterns))
456
+ patterns = [patterns];
457
+ return patterns.map((s) => {
458
+ if (typeof s === "string")
459
+ return { s };
460
+ return { r: { source: s.source, flags: s.flags } };
461
+ });
462
+ }
463
+ function parseRegexPatterns(patterns) {
464
+ return patterns.map((p) => {
465
+ if (p.s !== void 0)
466
+ return p.s;
467
+ return new RegExp(p.r.source, p.r.flags);
468
+ });
469
+ }
470
+ function computeTestCaseOutcome(test) {
471
+ let skipped = 0;
472
+ let didNotRun = 0;
473
+ let expected = 0;
474
+ let interrupted = 0;
475
+ let unexpected = 0;
476
+ for (const result of test.results) {
477
+ if (result.status === "interrupted") {
478
+ ++interrupted;
479
+ } else if (result.status === "skipped" && test.expectedStatus === "skipped") {
480
+ ++skipped;
481
+ } else if (result.status === "skipped") {
482
+ ++didNotRun;
483
+ } else if (result.status === test.expectedStatus) {
484
+ ++expected;
485
+ } else {
486
+ ++unexpected;
487
+ }
488
+ }
489
+ if (expected === 0 && unexpected === 0)
490
+ return "skipped";
491
+ if (unexpected === 0)
492
+ return "expected";
493
+ if (expected === 0 && skipped === 0)
494
+ return "unexpected";
495
+ return "flaky";
496
+ }
497
+ // Annotate the CommonJS export names for ESM import in node:
498
+ 0 && (module.exports = {
499
+ TeleReporterReceiver,
500
+ TeleSuite,
501
+ TeleTestCase,
502
+ TeleTestResult,
503
+ baseFullConfig,
504
+ computeTestCaseOutcome,
505
+ parseRegexPatterns,
506
+ serializeRegexPatterns
507
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/isomorphic/teleReceiver.ts"],
4
+ "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metadata, TestAnnotation } from '../../types/test';\nimport type * as reporterTypes from '../../types/testReporter';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\nexport type StringIntern = (s: string) => string;\nexport type JsonLocation = reporterTypes.Location;\nexport type JsonError = string;\nexport type JsonStackFrame = { file: string, line: number, column: number };\n\nexport type JsonStdIOType = 'stdout' | 'stderr';\n\nexport type JsonConfig = Pick<reporterTypes.FullConfig, 'configFile' | 'globalTimeout' | 'maxFailures' | 'metadata' | 'rootDir' | 'version' | 'workers' | 'globalSetup' | 'globalTeardown'>;\n\nexport type JsonPattern = {\n s?: string;\n r?: { source: string, flags: string };\n};\n\nexport type JsonProject = {\n grep: JsonPattern[];\n grepInvert: JsonPattern[];\n metadata: Metadata;\n name: string;\n dependencies: string[];\n // This is relative to root dir.\n snapshotDir: string;\n // This is relative to root dir.\n outputDir: string;\n repeatEach: number;\n retries: number;\n suites: JsonSuite[];\n teardown?: string;\n // This is relative to root dir.\n testDir: string;\n testIgnore: JsonPattern[];\n testMatch: JsonPattern[];\n timeout: number;\n use: { [key: string]: any };\n};\n\nexport type JsonSuite = {\n title: string;\n location?: JsonLocation;\n entries: (JsonSuite | JsonTestCase)[];\n};\n\nexport type JsonTestCase = {\n testId: string;\n title: string;\n location: JsonLocation;\n retries: number;\n tags?: string[];\n repeatEachIndex: number;\n annotations?: TestAnnotation[];\n};\n\nexport type JsonTestEnd = {\n testId: string;\n expectedStatus: reporterTypes.TestStatus;\n timeout: number;\n // Dropped in 1.52. Kept as empty array for backwards compatibility.\n annotations: [];\n};\n\nexport type JsonTestResultStart = {\n id: string;\n retry: number;\n workerIndex: number;\n parallelIndex: number;\n startTime: number;\n};\n\nexport type JsonAttachment = Omit<reporterTypes.TestResult['attachments'][0], 'body'> & { base64?: string; };\n\nexport type JsonTestResultEnd = {\n id: string;\n duration: number;\n status: reporterTypes.TestStatus;\n errors: reporterTypes.TestError[];\n /** No longer emitted, but kept for backwards compatibility */\n attachments?: JsonAttachment[];\n annotations?: TestAnnotation[];\n};\n\nexport type JsonTestStepStart = {\n id: string;\n parentStepId?: string;\n title: string;\n category: string,\n startTime: number;\n location?: reporterTypes.Location;\n};\n\nexport type JsonTestStepEnd = {\n id: string;\n duration: number;\n error?: reporterTypes.TestError;\n attachments?: number[]; // index of JsonTestResultEnd.attachments\n annotations?: TestAnnotation[];\n};\n\nexport type JsonTestResultOnAttach = {\n testId: string;\n resultId: string;\n attachments: JsonAttachment[];\n};\n\nexport type JsonFullResult = {\n status: reporterTypes.FullResult['status'];\n startTime: number;\n duration: number;\n};\n\nexport type JsonEvent = JsonOnConfigureEvent | JsonOnBlobReportMetadataEvent | JsonOnEndEvent | JsonOnExitEvent | JsonOnProjectEvent | JsonOnBeginEvent | JsonOnTestBeginEvent\n | JsonOnTestEndEvent | JsonOnStepBeginEvent | JsonOnStepEndEvent | JsonOnAttachEvent | JsonOnErrorEvent | JsonOnStdIOEvent;\n\nexport type JsonOnConfigureEvent = {\n method: 'onConfigure';\n params: {\n config: JsonConfig;\n };\n};\n\nexport type JsonOnBlobReportMetadataEvent = {\n method: 'onBlobReportMetadata';\n params: BlobReportMetadata;\n};\n\nexport type JsonOnProjectEvent = {\n method: 'onProject';\n params: {\n project: JsonProject;\n };\n};\n\nexport type JsonOnBeginEvent = {\n method: 'onBegin';\n params: undefined;\n};\n\nexport type JsonOnTestBeginEvent = {\n method: 'onTestBegin';\n params: {\n testId: string;\n result: JsonTestResultStart;\n };\n};\n\nexport type JsonOnTestEndEvent = {\n method: 'onTestEnd';\n params: {\n test: JsonTestEnd;\n testId?: string;\n result: JsonTestResultEnd;\n };\n};\n\nexport type JsonOnStepBeginEvent = {\n method: 'onStepBegin';\n params: {\n testId: string;\n resultId: string;\n step: JsonTestStepStart;\n };\n};\n\nexport type JsonOnStepEndEvent = {\n method: 'onStepEnd';\n params: {\n testId: string;\n resultId: string;\n step: JsonTestStepEnd;\n };\n};\n\nexport type JsonOnAttachEvent = {\n method: 'onAttach';\n params: JsonTestResultOnAttach;\n};\n\nexport type JsonOnErrorEvent = {\n method: 'onError';\n params: {\n error: reporterTypes.TestError;\n };\n};\n\nexport type JsonOnStdIOEvent = {\n method: 'onStdIO';\n params: {\n type: JsonStdIOType;\n testId?: string;\n resultId?: string;\n data: string;\n isBase64: boolean;\n };\n};\n\nexport type JsonOnEndEvent = {\n method: 'onEnd';\n params: {\n result: JsonFullResult;\n };\n};\n\nexport type JsonOnExitEvent = {\n method: 'onExit';\n params: undefined;\n};\n\nexport type BlobReportMetadata = {\n version: number;\n userAgent: string;\n name?: string;\n shard?: { total: number, current: number };\n pathSeparator?: string;\n};\n\ntype TeleReporterReceiverOptions = {\n mergeProjects?: boolean;\n mergeTestCases?: boolean;\n resolvePath?: (rootDir: string, relativePath: string) => string;\n configOverrides?: Pick<reporterTypes.FullConfig, 'configFile' | 'quiet' | 'reportSlowTests' | 'reporter'>;\n clearPreviousResultsWhenTestBegins?: boolean;\n};\n\nexport class TeleReporterReceiver {\n public isListing = false;\n private _rootSuite: TeleSuite;\n private _options: TeleReporterReceiverOptions;\n private _reporter: ReporterV2;\n private _tests = new Map<string, TeleTestCase>();\n private _rootDir!: string;\n private _config!: reporterTypes.FullConfig;\n\n constructor(reporter: ReporterV2, options: TeleReporterReceiverOptions = {}) {\n this._rootSuite = new TeleSuite('', 'root');\n this._options = options;\n this._reporter = reporter;\n }\n\n reset() {\n this._rootSuite._entries = [];\n this._tests.clear();\n }\n\n dispatch(message: JsonEvent): Promise<void> | void {\n const { method, params } = message;\n if (method === 'onConfigure') {\n this._onConfigure(params.config);\n return;\n }\n if (method === 'onProject') {\n this._onProject(params.project);\n return;\n }\n if (method === 'onBegin') {\n this._onBegin();\n return;\n }\n if (method === 'onTestBegin') {\n this._onTestBegin(params.testId, params.result);\n return;\n }\n if (method === 'onTestEnd') {\n this._onTestEnd(params.test, params.result);\n return;\n }\n if (method === 'onStepBegin') {\n this._onStepBegin(params.testId, params.resultId, params.step);\n return;\n }\n if (method === 'onAttach') {\n this._onAttach(params.testId, params.resultId, params.attachments);\n return;\n }\n if (method === 'onStepEnd') {\n this._onStepEnd(params.testId, params.resultId, params.step);\n return;\n }\n if (method === 'onError') {\n this._onError(params.error);\n return;\n }\n if (method === 'onStdIO') {\n this._onStdIO(params.type, params.testId, params.resultId, params.data, params.isBase64);\n return;\n }\n if (method === 'onEnd')\n return this._onEnd(params.result);\n if (method === 'onExit')\n return this._onExit();\n }\n\n private _onConfigure(config: JsonConfig) {\n this._rootDir = config.rootDir;\n this._config = this._parseConfig(config);\n this._reporter.onConfigure?.(this._config);\n }\n\n private _onProject(project: JsonProject) {\n let projectSuite = this._options.mergeProjects ? this._rootSuite.suites.find(suite => suite.project()!.name === project.name) : undefined;\n if (!projectSuite) {\n projectSuite = new TeleSuite(project.name, 'project');\n this._rootSuite._addSuite(projectSuite);\n }\n // Always update project in watch mode.\n projectSuite._project = this._parseProject(project);\n for (const suite of project.suites)\n this._mergeSuiteInto(suite, projectSuite);\n }\n\n private _onBegin() {\n this._reporter.onBegin?.(this._rootSuite);\n }\n\n private _onTestBegin(testId: string, payload: JsonTestResultStart) {\n const test = this._tests.get(testId)!;\n if (this._options.clearPreviousResultsWhenTestBegins)\n test.results = [];\n const testResult = test._createTestResult(payload.id);\n testResult.retry = payload.retry;\n testResult.workerIndex = payload.workerIndex;\n testResult.parallelIndex = payload.parallelIndex;\n testResult.setStartTimeNumber(payload.startTime);\n this._reporter.onTestBegin?.(test, testResult);\n }\n\n private _onTestEnd(testEndPayload: JsonTestEnd, payload: JsonTestResultEnd) {\n const test = this._tests.get(testEndPayload.testId)!;\n test.timeout = testEndPayload.timeout;\n test.expectedStatus = testEndPayload.expectedStatus;\n const result = test.results.find(r => r._id === payload.id)!;\n result.duration = payload.duration;\n result.status = payload.status;\n result.errors = payload.errors;\n result.error = result.errors?.[0];\n // Attachments are only present here from legacy blobs. These override all _onAttach events\n if (!!payload.attachments)\n result.attachments = this._parseAttachments(payload.attachments);\n if (payload.annotations) {\n this._absoluteAnnotationLocationsInplace(payload.annotations);\n result.annotations = payload.annotations;\n test.annotations = payload.annotations;\n }\n this._reporter.onTestEnd?.(test, result);\n // Free up the memory as won't see these step ids.\n result._stepMap = new Map();\n }\n\n private _onStepBegin(testId: string, resultId: string, payload: JsonTestStepStart) {\n const test = this._tests.get(testId)!;\n const result = test.results.find(r => r._id === resultId)!;\n const parentStep = payload.parentStepId ? result._stepMap.get(payload.parentStepId) : undefined;\n\n const location = this._absoluteLocation(payload.location);\n const step = new TeleTestStep(payload, parentStep, location, result);\n if (parentStep)\n parentStep.steps.push(step);\n else\n result.steps.push(step);\n result._stepMap.set(payload.id, step);\n this._reporter.onStepBegin?.(test, result, step);\n }\n\n private _onStepEnd(testId: string, resultId: string, payload: JsonTestStepEnd) {\n const test = this._tests.get(testId)!;\n const result = test.results.find(r => r._id === resultId)!;\n const step = result._stepMap.get(payload.id)!;\n step._endPayload = payload;\n step.duration = payload.duration;\n step.error = payload.error;\n this._reporter.onStepEnd?.(test, result, step);\n }\n\n private _onAttach(testId: string, resultId: string, attachments: JsonAttachment[]) {\n const test = this._tests.get(testId)!;\n const result = test.results.find(r => r._id === resultId)!;\n result.attachments.push(...attachments.map(a => ({\n name: a.name,\n contentType: a.contentType,\n path: a.path,\n body: a.base64 && (globalThis as any).Buffer ? Buffer.from(a.base64, 'base64') : undefined,\n })));\n }\n\n private _onError(error: reporterTypes.TestError) {\n this._reporter.onError?.(error);\n }\n\n private _onStdIO(type: JsonStdIOType, testId: string | undefined, resultId: string | undefined, data: string, isBase64: boolean) {\n const chunk = isBase64 ? ((globalThis as any).Buffer ? Buffer.from(data, 'base64') : atob(data)) : data;\n const test = testId ? this._tests.get(testId) : undefined;\n const result = test && resultId ? test.results.find(r => r._id === resultId) : undefined;\n if (type === 'stdout') {\n result?.stdout.push(chunk);\n this._reporter.onStdOut?.(chunk, test, result);\n } else {\n result?.stderr.push(chunk);\n this._reporter.onStdErr?.(chunk, test, result);\n }\n }\n\n private async _onEnd(result: JsonFullResult): Promise<void> {\n await this._reporter.onEnd?.({\n status: result.status,\n startTime: new Date(result.startTime),\n duration: result.duration,\n });\n }\n\n private _onExit(): Promise<void> | void {\n return this._reporter.onExit?.();\n }\n\n private _parseConfig(config: JsonConfig): reporterTypes.FullConfig {\n const result = { ...baseFullConfig, ...config };\n if (this._options.configOverrides) {\n result.configFile = this._options.configOverrides.configFile;\n result.reportSlowTests = this._options.configOverrides.reportSlowTests;\n result.quiet = this._options.configOverrides.quiet;\n result.reporter = [...this._options.configOverrides.reporter];\n }\n return result;\n }\n\n private _parseProject(project: JsonProject): TeleFullProject {\n return {\n metadata: project.metadata,\n name: project.name,\n outputDir: this._absolutePath(project.outputDir),\n repeatEach: project.repeatEach,\n retries: project.retries,\n testDir: this._absolutePath(project.testDir),\n testIgnore: parseRegexPatterns(project.testIgnore),\n testMatch: parseRegexPatterns(project.testMatch),\n timeout: project.timeout,\n grep: parseRegexPatterns(project.grep) as RegExp[],\n grepInvert: parseRegexPatterns(project.grepInvert) as RegExp[],\n dependencies: project.dependencies,\n teardown: project.teardown,\n snapshotDir: this._absolutePath(project.snapshotDir),\n use: project.use,\n };\n }\n\n private _parseAttachments(attachments: JsonAttachment[]): reporterTypes.TestResult['attachments'] {\n return attachments.map(a => {\n return {\n ...a,\n body: a.base64 && (globalThis as any).Buffer ? Buffer.from(a.base64, 'base64') : undefined,\n };\n });\n }\n\n private _mergeSuiteInto(jsonSuite: JsonSuite, parent: TeleSuite): void {\n let targetSuite = parent.suites.find(s => s.title === jsonSuite.title);\n if (!targetSuite) {\n targetSuite = new TeleSuite(jsonSuite.title, parent.type === 'project' ? 'file' : 'describe');\n parent._addSuite(targetSuite);\n }\n targetSuite.location = this._absoluteLocation(jsonSuite.location);\n jsonSuite.entries.forEach(e => {\n if ('testId' in e)\n this._mergeTestInto(e, targetSuite!);\n else\n this._mergeSuiteInto(e, targetSuite!);\n });\n }\n\n private _mergeTestInto(jsonTest: JsonTestCase, parent: TeleSuite) {\n let targetTest = this._options.mergeTestCases ? parent.tests.find(s => s.title === jsonTest.title && s.repeatEachIndex === jsonTest.repeatEachIndex) : undefined;\n if (!targetTest) {\n targetTest = new TeleTestCase(jsonTest.testId, jsonTest.title, this._absoluteLocation(jsonTest.location), jsonTest.repeatEachIndex);\n parent._addTest(targetTest);\n this._tests.set(targetTest.id, targetTest);\n }\n this._updateTest(jsonTest, targetTest);\n }\n\n private _updateTest(payload: JsonTestCase, test: TeleTestCase): TeleTestCase {\n test.id = payload.testId;\n test.location = this._absoluteLocation(payload.location);\n test.retries = payload.retries;\n test.tags = payload.tags ?? [];\n test.annotations = payload.annotations ?? [];\n this._absoluteAnnotationLocationsInplace(test.annotations);\n return test;\n }\n\n private _absoluteAnnotationLocationsInplace(annotations: TestAnnotation[]) {\n for (const annotation of annotations) {\n if (annotation.location)\n annotation.location = this._absoluteLocation(annotation.location);\n }\n }\n\n private _absoluteLocation(location: reporterTypes.Location): reporterTypes.Location;\n private _absoluteLocation(location?: reporterTypes.Location): reporterTypes.Location | undefined;\n private _absoluteLocation(location: reporterTypes.Location | undefined): reporterTypes.Location | undefined {\n if (!location)\n return location;\n return {\n ...location,\n file: this._absolutePath(location.file),\n };\n }\n\n private _absolutePath(relativePath: string): string;\n private _absolutePath(relativePath?: string): string | undefined;\n private _absolutePath(relativePath?: string): string | undefined {\n if (relativePath === undefined)\n return;\n return this._options.resolvePath ? this._options.resolvePath(this._rootDir, relativePath) : this._rootDir + '/' + relativePath;\n }\n}\n\nexport class TeleSuite implements reporterTypes.Suite {\n title: string;\n location?: reporterTypes.Location;\n parent?: TeleSuite;\n _entries: (TeleSuite | TeleTestCase)[] = [];\n _requireFile: string = '';\n _timeout: number | undefined;\n _retries: number | undefined;\n _project: TeleFullProject | undefined;\n _parallelMode: 'none' | 'default' | 'serial' | 'parallel' = 'none';\n private readonly _type: 'root' | 'project' | 'file' | 'describe';\n\n constructor(title: string, type: 'root' | 'project' | 'file' | 'describe') {\n this.title = title;\n this._type = type;\n }\n\n get type() {\n return this._type;\n }\n\n get suites(): TeleSuite[] {\n return this._entries.filter(e => e.type !== 'test') as TeleSuite[];\n }\n\n get tests(): TeleTestCase[] {\n return this._entries.filter(e => e.type === 'test') as TeleTestCase[];\n }\n\n entries() {\n return this._entries;\n }\n\n allTests(): reporterTypes.TestCase[] {\n const result: reporterTypes.TestCase[] = [];\n const visit = (suite: reporterTypes.Suite) => {\n for (const entry of suite.entries()) {\n if (entry.type === 'test')\n result.push(entry);\n else\n visit(entry);\n }\n };\n visit(this);\n return result;\n }\n\n titlePath(): string[] {\n const titlePath = this.parent ? this.parent.titlePath() : [];\n // Ignore anonymous describe blocks.\n if (this.title || this._type !== 'describe')\n titlePath.push(this.title);\n return titlePath;\n }\n\n project(): TeleFullProject | undefined {\n return this._project ?? this.parent?.project();\n }\n\n _addTest(test: TeleTestCase) {\n test.parent = this;\n this._entries.push(test);\n }\n\n _addSuite(suite: TeleSuite) {\n suite.parent = this;\n this._entries.push(suite);\n }\n}\n\nexport class TeleTestCase implements reporterTypes.TestCase {\n title: string;\n fn = () => {};\n results: TeleTestResult[] = [];\n location: reporterTypes.Location;\n parent!: TeleSuite;\n type: 'test' = 'test';\n\n expectedStatus: reporterTypes.TestStatus = 'passed';\n timeout = 0;\n annotations: TestAnnotation[] = [];\n retries = 0;\n tags: string[] = [];\n repeatEachIndex = 0;\n id: string;\n\n constructor(id: string, title: string, location: reporterTypes.Location, repeatEachIndex: number) {\n this.id = id;\n this.title = title;\n this.location = location;\n this.repeatEachIndex = repeatEachIndex;\n }\n\n titlePath(): string[] {\n const titlePath = this.parent ? this.parent.titlePath() : [];\n titlePath.push(this.title);\n return titlePath;\n }\n\n outcome(): 'skipped' | 'expected' | 'unexpected' | 'flaky' {\n return computeTestCaseOutcome(this);\n }\n\n ok(): boolean {\n const status = this.outcome();\n return status === 'expected' || status === 'flaky' || status === 'skipped';\n }\n\n _createTestResult(id: string): TeleTestResult {\n const result = new TeleTestResult(this.results.length, id);\n this.results.push(result);\n return result;\n }\n}\n\nclass TeleTestStep implements reporterTypes.TestStep {\n title: string;\n category: string;\n location: reporterTypes.Location | undefined;\n parent: reporterTypes.TestStep | undefined;\n duration: number = -1;\n steps: reporterTypes.TestStep[] = [];\n error: reporterTypes.TestError | undefined;\n\n private _result: TeleTestResult;\n _endPayload?: JsonTestStepEnd;\n\n private _startTime: number = 0;\n\n constructor(payload: JsonTestStepStart, parentStep: reporterTypes.TestStep | undefined, location: reporterTypes.Location | undefined, result: TeleTestResult) {\n this.title = payload.title;\n this.category = payload.category;\n this.location = location;\n this.parent = parentStep;\n this._startTime = payload.startTime;\n this._result = result;\n }\n\n titlePath() {\n const parentPath = this.parent?.titlePath() || [];\n return [...parentPath, this.title];\n }\n\n get startTime(): Date {\n return new Date(this._startTime);\n }\n\n set startTime(value: Date) {\n this._startTime = +value;\n }\n\n get attachments() {\n return this._endPayload?.attachments?.map(index => this._result.attachments[index]) ?? [];\n }\n\n get annotations() {\n return this._endPayload?.annotations ?? [];\n }\n}\n\nexport class TeleTestResult implements reporterTypes.TestResult {\n retry: reporterTypes.TestResult['retry'];\n parallelIndex: reporterTypes.TestResult['parallelIndex'] = -1;\n workerIndex: reporterTypes.TestResult['workerIndex'] = -1;\n duration: reporterTypes.TestResult['duration'] = -1;\n stdout: reporterTypes.TestResult['stdout'] = [];\n stderr: reporterTypes.TestResult['stderr'] = [];\n attachments: reporterTypes.TestResult['attachments'] = [];\n annotations: reporterTypes.TestResult['annotations'] = [];\n status: reporterTypes.TestStatus = 'skipped';\n steps: TeleTestStep[] = [];\n errors: reporterTypes.TestResult['errors'] = [];\n error: reporterTypes.TestResult['error'];\n\n _stepMap = new Map<string, TeleTestStep>();\n _id: string;\n\n private _startTime: number = 0;\n\n constructor(retry: number, id: string) {\n this.retry = retry;\n this._id = id;\n }\n\n setStartTimeNumber(startTime: number) {\n this._startTime = startTime;\n }\n\n get startTime(): Date {\n return new Date(this._startTime);\n }\n\n set startTime(value: Date) {\n this._startTime = +value;\n }\n}\n\nexport type TeleFullProject = reporterTypes.FullProject;\n\nexport const baseFullConfig: reporterTypes.FullConfig = {\n forbidOnly: false,\n fullyParallel: false,\n globalSetup: null,\n globalTeardown: null,\n globalTimeout: 0,\n grep: /.*/,\n grepInvert: null,\n maxFailures: 0,\n metadata: {},\n preserveOutput: 'always',\n projects: [],\n reporter: [[process.env.CI ? 'dot' : 'list']],\n reportSlowTests: { max: 5, threshold: 300_000 /* 5 minutes */ },\n configFile: '',\n rootDir: '',\n quiet: false,\n shard: null,\n updateSnapshots: 'missing',\n updateSourceMethod: 'patch',\n version: '',\n workers: 0,\n webServer: null,\n};\n\nexport function serializeRegexPatterns(patterns: string | RegExp | (string | RegExp)[]): JsonPattern[] {\n if (!Array.isArray(patterns))\n patterns = [patterns];\n return patterns.map(s => {\n if (typeof s === 'string')\n return { s };\n return { r: { source: s.source, flags: s.flags } };\n });\n}\n\nexport function parseRegexPatterns(patterns: JsonPattern[]): (string | RegExp)[] {\n return patterns.map(p => {\n if (p.s !== undefined)\n return p.s;\n return new RegExp(p.r!.source, p.r!.flags);\n });\n}\n\nexport function computeTestCaseOutcome(test: reporterTypes.TestCase) {\n let skipped = 0;\n let didNotRun = 0;\n let expected = 0;\n let interrupted = 0;\n let unexpected = 0;\n for (const result of test.results) {\n if (result.status === 'interrupted') {\n ++interrupted; // eslint-disable-line @typescript-eslint/no-unused-vars\n } else if (result.status === 'skipped' && test.expectedStatus === 'skipped') {\n // Only tests \"expected to be skipped\" are skipped. These were specifically\n // marked with test.skip or test.fixme.\n ++skipped;\n } else if (result.status === 'skipped') {\n // Tests that were expected to run, but were skipped are \"did not run\".\n // This happens when:\n // - testing finished early;\n // - test failure prevented other tests in the serial suite to run;\n // - probably more cases!\n ++didNotRun; // eslint-disable-line @typescript-eslint/no-unused-vars\n } else if (result.status === test.expectedStatus) {\n // Either passed and expected to pass, or failed and expected to fail.\n ++expected;\n } else {\n ++unexpected;\n }\n }\n\n // Tests that were \"skipped as expected\" are considered equal to \"expected\" below,\n // because that's the expected outcome.\n //\n // However, we specifically differentiate the case of \"only skipped\"\n // and show it as \"skipped\" in all reporters.\n //\n // More exotic cases like \"failed on first run and skipped on retry\" are flaky.\n if (expected === 0 && unexpected === 0)\n return 'skipped'; // all results were skipped or interrupted\n if (unexpected === 0)\n return 'expected'; // no failures, just expected+skipped\n if (expected === 0 && skipped === 0)\n return 'unexpected'; // only failures\n return 'flaky'; // expected+unexpected or skipped+unexpected\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkPO,MAAM,qBAAqB;AAAA,EAShC,YAAY,UAAsB,UAAuC,CAAC,GAAG;AAR7E,SAAO,YAAY;AAInB,SAAQ,SAAS,oBAAI,IAA0B;AAK7C,SAAK,aAAa,IAAI,UAAU,IAAI,MAAM;AAC1C,SAAK,WAAW;AAChB,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,QAAQ;AACN,SAAK,WAAW,WAAW,CAAC;AAC5B,SAAK,OAAO,MAAM;AAAA,EACpB;AAAA,EAEA,SAAS,S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