allure-js-commons 3.5.0 → 3.7.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 (59) hide show
  1. package/README.md +176 -6
  2. package/dist/cjs/facade.js.map +1 -1
  3. package/dist/cjs/sdk/index.js +6 -0
  4. package/dist/cjs/sdk/index.js.map +1 -1
  5. package/dist/cjs/sdk/reporter/ReporterRuntime.js +1 -1
  6. package/dist/cjs/sdk/reporter/ReporterRuntime.js.map +1 -1
  7. package/dist/cjs/sdk/reporter/testplan.js.map +1 -1
  8. package/dist/cjs/sdk/reporter/utils/envInfo.js +2 -1
  9. package/dist/cjs/sdk/reporter/utils/envInfo.js.map +1 -1
  10. package/dist/cjs/sdk/reporter/utils/labels.js.map +1 -1
  11. package/dist/cjs/sdk/reporter/utils.js.map +1 -1
  12. package/dist/cjs/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
  13. package/dist/cjs/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
  14. package/dist/cjs/sdk/reporter/writer/MessageWriter.js.map +1 -1
  15. package/dist/cjs/sdk/runtime/MessageTestRuntime.js +63 -46
  16. package/dist/cjs/sdk/runtime/MessageTestRuntime.js.map +1 -1
  17. package/dist/cjs/sdk/runtime/index.js +6 -0
  18. package/dist/cjs/sdk/runtime/index.js.map +1 -1
  19. package/dist/cjs/sdk/runtime/runtime.js +2 -1
  20. package/dist/cjs/sdk/runtime/runtime.js.map +1 -1
  21. package/dist/cjs/sdk/runtime/types.js.map +1 -1
  22. package/dist/cjs/sdk/utils.js +13 -1
  23. package/dist/cjs/sdk/utils.js.map +1 -1
  24. package/dist/esm/facade.js.map +1 -1
  25. package/dist/esm/sdk/index.js +1 -1
  26. package/dist/esm/sdk/index.js.map +1 -1
  27. package/dist/esm/sdk/reporter/ReporterRuntime.js +1 -1
  28. package/dist/esm/sdk/reporter/ReporterRuntime.js.map +1 -1
  29. package/dist/esm/sdk/reporter/testplan.js.map +1 -1
  30. package/dist/esm/sdk/reporter/utils/envInfo.js +3 -1
  31. package/dist/esm/sdk/reporter/utils/envInfo.js.map +1 -1
  32. package/dist/esm/sdk/reporter/utils/labels.js.map +1 -1
  33. package/dist/esm/sdk/reporter/utils.js.map +1 -1
  34. package/dist/esm/sdk/reporter/writer/FileSystemWriter.js.map +1 -1
  35. package/dist/esm/sdk/reporter/writer/InMemoryWriter.js.map +1 -1
  36. package/dist/esm/sdk/reporter/writer/MessageWriter.js.map +1 -1
  37. package/dist/esm/sdk/runtime/MessageTestRuntime.js +61 -44
  38. package/dist/esm/sdk/runtime/MessageTestRuntime.js.map +1 -1
  39. package/dist/esm/sdk/runtime/index.js +1 -1
  40. package/dist/esm/sdk/runtime/index.js.map +1 -1
  41. package/dist/esm/sdk/runtime/runtime.js +1 -1
  42. package/dist/esm/sdk/runtime/runtime.js.map +1 -1
  43. package/dist/esm/sdk/runtime/types.js.map +1 -1
  44. package/dist/esm/sdk/utils.js +11 -4
  45. package/dist/esm/sdk/utils.js.map +1 -1
  46. package/dist/types/facade.d.ts +3 -2
  47. package/dist/types/model.d.ts +1 -0
  48. package/dist/types/sdk/index.d.ts +1 -1
  49. package/dist/types/sdk/reporter/ReporterRuntime.d.ts +1 -0
  50. package/dist/types/sdk/reporter/types.d.ts +1 -0
  51. package/dist/types/sdk/reporter/writer/FileSystemWriter.d.ts +1 -0
  52. package/dist/types/sdk/reporter/writer/InMemoryWriter.d.ts +1 -0
  53. package/dist/types/sdk/reporter/writer/MessageWriter.d.ts +1 -0
  54. package/dist/types/sdk/runtime/MessageTestRuntime.d.ts +8 -3
  55. package/dist/types/sdk/runtime/index.d.ts +1 -1
  56. package/dist/types/sdk/runtime/types.d.ts +3 -2
  57. package/dist/types/sdk/types.d.ts +1 -0
  58. package/dist/types/sdk/utils.d.ts +6 -1
  59. package/package.json +25 -36
package/README.md CHANGED
@@ -12,15 +12,185 @@
12
12
 
13
13
  ---
14
14
 
15
- Interface for Allure to be used from Javascript and TypeScript.
16
- There you can find primitives to create custom integrations for the javascript testing frameworks.
15
+ `allure-js-commons` is the shared runtime API and reporter SDK used by the packages in this repository. It gives you both:
17
16
 
18
- ## API Overview
17
+ - a high-level facade for test code, such as `allure.step()`, `allure.attachment()`, `allure.owner()`, and `allure.epic()`
18
+ - low-level building blocks for custom integrations, such as `ReporterRuntime`, writers, runtime message transport, and result model factories
19
19
 
20
- ### Labels environment variables
20
+ Use it when you want to:
21
21
 
22
- Allure allows to use environment variables for setting test labels.
23
- Using `ALLURE_LABEL_{{labelName}}={{labelValue}}` syntax you can set common labels for all of your tests.
22
+ - enrich tests with Allure metadata from JavaScript or TypeScript
23
+ - write your own test framework integration
24
+ - build a custom adapter that emits standard `allure-results`
25
+ - reuse the same reporting model across multiple runners or tools
26
+
27
+ ## Installation
28
+
29
+ Install the package with your package manager of choice:
30
+
31
+ ```bash
32
+ npm install -D allure-js-commons
33
+ ```
34
+
35
+ If you are building a custom integration, install your framework alongside it and add Allure Report separately when you want to render results:
36
+
37
+ - follow the [Allure Report 2 installation guide](https://allurereport.org/docs/install/) to use the `allure` CLI
38
+ - or install Allure Report 3 with `npm install -D allure` to use `npx allure`
39
+
40
+ ## View the report
41
+
42
+ If your integration writes `./allure-results`, you can render it with either report generator.
43
+
44
+ Use Allure Report 2:
45
+
46
+ ```bash
47
+ allure generate ./allure-results -o ./allure-report
48
+ allure open ./allure-report
49
+ ```
50
+
51
+ Or use Allure Report 3:
52
+
53
+ ```bash
54
+ npx allure generate ./allure-results
55
+ npx allure open ./allure-report
56
+ ```
57
+
58
+ ## Supported versions and platforms
59
+
60
+ - works in Node.js environments on Linux, macOS, and Windows
61
+ - used by the official integrations in this repository, which are validated in CI on Node.js 20 and 22
62
+ - intended for frameworks and tooling that can produce or consume Allure runtime messages and result files
63
+
64
+ ## Overview
65
+
66
+ ### High-level facade
67
+
68
+ The package root exports the API used directly inside tests:
69
+
70
+ - labels and links: `epic`, `feature`, `story`, `owner`, `severity`, `issue`, `tms`, `tag`
71
+ - descriptions and identifiers: `description`, `descriptionHtml`, `displayName`, `historyId`, `testCaseId`
72
+ - execution details: `parameter`, `step`, `logStep`
73
+ - attachments: `attachment`, `attachmentPath`, `globalAttachment`, `globalAttachmentPath`
74
+
75
+ These helpers delegate to the active test runtime, which integrations register with `setGlobalTestRuntime()`.
76
+
77
+ ### Reporter SDK
78
+
79
+ The `allure-js-commons/sdk` entry points expose the pieces used by official integrations:
80
+
81
+ - `sdk/runtime`: runtime message transport and global runtime registration
82
+ - `sdk/reporter`: `ReporterRuntime`, writers, result factories, categories, environment info, and helper utilities
83
+ - `sdk`: shared types, runtime message definitions, serialization helpers, and metadata parsing helpers
84
+
85
+ ## Basic usage in tests
86
+
87
+ ```ts
88
+ import * as allure from "allure-js-commons";
89
+
90
+ await allure.epic("Authentication");
91
+ await allure.feature("Password sign-in");
92
+ await allure.owner("qa-team");
93
+ await allure.parameter("browser", "chromium");
94
+
95
+ await allure.step("Submit valid credentials", async () => {
96
+ await allure.attachment("request", JSON.stringify({ login: "jane" }), {
97
+ contentType: "application/json",
98
+ });
99
+ });
100
+ ```
101
+
102
+ ## Creating your own integration
103
+
104
+ The official adapters in this repository follow the same basic flow:
105
+
106
+ 1. Create a `ReporterRuntime` with a writer that persists `allure-results`.
107
+ 2. Register a test runtime with `setGlobalTestRuntime()` so `allure-js-commons` calls inside tests can emit runtime messages.
108
+ 3. Map your framework lifecycle events to `startTest`, `updateTest`, `stopTest`, `writeTest`, and optional scope or fixture methods.
109
+ 4. Forward runtime messages from the active test into `ReporterRuntime.applyRuntimeMessages()`.
110
+
111
+ Here is a minimal example:
112
+
113
+ ```ts
114
+ import { Stage, Status } from "allure-js-commons";
115
+ import type { RuntimeMessage } from "allure-js-commons/sdk";
116
+ import { ReporterRuntime, createDefaultWriter } from "allure-js-commons/sdk/reporter";
117
+ import { MessageTestRuntime, setGlobalTestRuntime } from "allure-js-commons/sdk/runtime";
118
+
119
+ class MyFrameworkRuntime extends MessageTestRuntime {
120
+ constructor(private readonly forward: (message: RuntimeMessage) => void) {
121
+ super();
122
+ }
123
+
124
+ async sendMessage(message: RuntimeMessage) {
125
+ this.forward(message);
126
+ }
127
+ }
128
+
129
+ const reporterRuntime = new ReporterRuntime({
130
+ writer: createDefaultWriter({ resultsDir: "./allure-results" }),
131
+ });
132
+
133
+ let currentTestUuid: string | undefined;
134
+
135
+ setGlobalTestRuntime(
136
+ new MyFrameworkRuntime((message) => {
137
+ if (currentTestUuid) {
138
+ reporterRuntime.applyRuntimeMessages(currentTestUuid, [message]);
139
+ } else {
140
+ reporterRuntime.applyGlobalRuntimeMessages([message]);
141
+ }
142
+ }),
143
+ );
144
+
145
+ export const onTestStart = (name: string, fullName: string) => {
146
+ currentTestUuid = reporterRuntime.startTest({
147
+ name,
148
+ fullName,
149
+ stage: Stage.RUNNING,
150
+ });
151
+ };
152
+
153
+ export const onTestPass = () => {
154
+ if (!currentTestUuid) return;
155
+ reporterRuntime.updateTest(currentTestUuid, (result) => {
156
+ result.status = Status.PASSED;
157
+ result.stage = Stage.FINISHED;
158
+ });
159
+ reporterRuntime.stopTest(currentTestUuid);
160
+ reporterRuntime.writeTest(currentTestUuid);
161
+ currentTestUuid = undefined;
162
+ };
163
+
164
+ export const onTestFail = (error: Error) => {
165
+ if (!currentTestUuid) return;
166
+ reporterRuntime.updateTest(currentTestUuid, (result) => {
167
+ result.status = Status.BROKEN;
168
+ result.stage = Stage.FINISHED;
169
+ result.statusDetails = {
170
+ message: error.message,
171
+ trace: error.stack,
172
+ };
173
+ });
174
+ reporterRuntime.stopTest(currentTestUuid);
175
+ reporterRuntime.writeTest(currentTestUuid);
176
+ currentTestUuid = undefined;
177
+ };
178
+ ```
179
+
180
+ This approach lets framework callbacks manage test lifecycle state while user code keeps using the regular `allure-js-commons` facade.
181
+
182
+ ## Useful building blocks
183
+
184
+ - `ReporterRuntime`: creates and writes tests, fixtures, steps, attachments, categories, and environment info
185
+ - `createDefaultWriter()`: writes to `./allure-results` in normal runs and switches to a message writer in test mode
186
+ - `FileSystemWriter`, `InMemoryWriter`, `MessageWriter`, `MessageReader`: transport and persistence helpers
187
+ - `setGlobalTestRuntime()`: connects the facade API to the currently active framework runtime
188
+ - `MessageTestRuntime` and `MessageHolderTestRuntime`: ready-made runtime message implementations for adapters
189
+ - `createTestResult()`, `createStepResult()`, `createFixtureResult()`, `createTestResultContainer()`: factories for manual result construction
190
+
191
+ ## Labels from environment variables
192
+
193
+ Allure allows you to apply labels to every test through environment variables. Use the `ALLURE_LABEL_<labelName>=<labelValue>` format.
24
194
 
25
195
  #### Examples
26
196
 
@@ -1 +1 @@
1
- {"version":3,"file":"facade.js","names":["_model","require","_runtime","_utils","callRuntimeMethod","method","_len","arguments","length","args","Array","_key","runtime","getGlobalTestRuntimeWithAutoconfig","isPromise","then","testRuntime","label","name","value","exports","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","opts","contentType","globalAttachment","globalAttachmentPath","path","globalError","details","attachTrace","attachmentPath","stepContext","mode","logStep","status","error","step","body","issue","LinkType","ISSUE","tms","TMS","allureId","LabelName","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len4","tagsList","_key4","map"],"sources":["../../src/facade.ts"],"sourcesContent":["import type { Status, StatusDetails } from \"./model.js\";\nimport { type ContentType } from \"./model.js\";\nimport { type AttachmentOptions, type Label, type Link, type ParameterMode, type ParameterOptions } from \"./model.js\";\nimport { LabelName, LinkType } from \"./model.js\";\nimport { getGlobalTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { TestRuntime } from \"./sdk/runtime/types.js\";\nimport { isPromise } from \"./sdk/utils.js\";\n\nconst callRuntimeMethod = <\n T extends keyof TestRuntime,\n S extends Parameters<TestRuntime[T]>,\n R extends ReturnType<TestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalTestRuntimeWithAutoconfig();\n\n if (!isPromise(runtime)) {\n // @ts-ignore\n return runtime[method](...args);\n }\n\n return runtime.then((testRuntime) => {\n // @ts-ignore\n return testRuntime[method](...args);\n }) as R;\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const globalAttachment = (\n name: string,\n content: Buffer | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachment\", name, content, opts);\n};\n\nexport const globalAttachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachmentFromPath\", name, path, opts);\n};\n\nexport const globalError = (details: StatusDetails) => {\n return callRuntimeMethod(\"globalError\", details);\n};\n\nexport const attachTrace = (name: string, path: string) => {\n return callRuntimeMethod(\"attachmentFromPath\", name, path, {\n contentType: \"application/vnd.allure.playwright-trace\",\n });\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nexport type StepContext = {\n displayName: (name: string) => void | PromiseLike<void>;\n parameter: (name: string, value: string, mode?: ParameterMode) => void | PromiseLike<void>;\n};\n\nconst stepContext: () => StepContext = () => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): PromiseLike<void> => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: StepContext) => T | PromiseLike<T>): PromiseLike<T> => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\"labels\", ...tagsList.map((value) => ({ name: LabelName.TAG, value })));\n};\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAMG,iBAAiB,GAAG,SAApBA,iBAAiBA,CAKrBC,MAAS,EAEH;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EADHC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;EAAA;EAEP,IAAMC,OAAO,GAAG,IAAAC,2CAAkC,EAAC,CAAC;EAEpD,IAAI,CAAC,IAAAC,gBAAS,EAACF,OAAO,CAAC,EAAE;IACvB;IACA,OAAOA,OAAO,CAACP,MAAM,CAAC,CAAC,GAAGI,IAAI,CAAC;EACjC;EAEA,OAAOG,OAAO,CAACG,IAAI,CAAEC,WAAW,IAAK;IACnC;IACA,OAAOA,WAAW,CAACX,MAAM,CAAC,CAAC,GAAGI,IAAI,CAAC;EACrC,CAAC,CAAC;AACJ,CAAC;AAEM,IAAMQ,KAAK,GAAGA,CAACC,IAAwB,EAAEC,KAAa,KAAK;EAChE,OAAOf,iBAAiB,CAAC,QAAQ,EAAE;IAAEc,IAAI;IAAEC;EAAM,CAAC,CAAC;AACrD,CAAC;AAACC,OAAA,CAAAH,KAAA,GAAAA,KAAA;AAEK,IAAMI,MAAM,GAAAD,OAAA,CAAAC,MAAA,GAAG,SAATA,MAAMA,CAAA,EAA+B;EAAA,SAAAC,KAAA,GAAAf,SAAA,CAAAC,MAAA,EAAxBe,UAAU,OAAAb,KAAA,CAAAY,KAAA,GAAAE,KAAA,MAAAA,KAAA,GAAAF,KAAA,EAAAE,KAAA;IAAVD,UAAU,CA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GAAGqF,QAAQ,CAACE,GAAG,CAAExE,KAAK,KAAM;IAAED,IAAI,EAAE+C,gBAAS,CAACqB,GAAG;IAAEnE;EAAM,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"facade.js","names":["_model","require","_runtime","_utils","callRuntimeMethod","method","_len","arguments","length","args","Array","_key","runtime","getGlobalTestRuntimeWithAutoconfig","isPromise","then","testRuntime","label","name","value","exports","labels","_len2","labelsList","_key2","link","url","type","links","_len3","linksList","_key3","parameter","options","description","markdown","descriptionHtml","html","displayName","historyId","testCaseId","attachment","content","opts","contentType","globalAttachment","globalAttachmentPath","path","globalError","details","attachTrace","attachmentPath","stepContext","mode","logStep","status","error","step","body","issue","LinkType","ISSUE","tms","TMS","allureId","LabelName","ALLURE_ID","epic","EPIC","feature","FEATURE","story","STORY","suite","SUITE","parentSuite","PARENT_SUITE","subSuite","SUB_SUITE","owner","OWNER","severity","SEVERITY","layer","LAYER","tag","TAG","tags","_len4","tagsList","_key4","map"],"sources":["../../src/facade.ts"],"sourcesContent":["import type { Status, StatusDetails } from \"./model.js\";\nimport { type ContentType } from \"./model.js\";\nimport { type AttachmentOptions, type Label, type Link, type ParameterMode, type ParameterOptions } from \"./model.js\";\nimport { LabelName, LinkType } from \"./model.js\";\nimport { getGlobalTestRuntimeWithAutoconfig } from \"./sdk/runtime/runtime.js\";\nimport type { TestRuntime } from \"./sdk/runtime/types.js\";\nimport { isPromise } from \"./sdk/utils.js\";\n\nconst callRuntimeMethod = <\n T extends keyof TestRuntime,\n S extends Parameters<TestRuntime[T]>,\n R extends ReturnType<TestRuntime[T]>,\n>(\n method: T,\n ...args: S\n): R => {\n const runtime = getGlobalTestRuntimeWithAutoconfig();\n\n if (!isPromise(runtime)) {\n // @ts-ignore\n return runtime[method](...args);\n }\n\n return runtime.then((testRuntime) => {\n // @ts-ignore\n return testRuntime[method](...args);\n }) as R;\n};\n\nexport const label = (name: LabelName | string, value: string) => {\n return callRuntimeMethod(\"labels\", { name, value });\n};\n\nexport const labels = (...labelsList: Label[]) => {\n return callRuntimeMethod(\"labels\", ...labelsList);\n};\n\nexport const link = (url: string, name?: string, type?: LinkType | string) => {\n return callRuntimeMethod(\"links\", { url, type, name });\n};\n\nexport const links = (...linksList: Link[]) => {\n return callRuntimeMethod(\"links\", ...linksList);\n};\n\nexport const parameter = (name: string, value: string, options?: ParameterOptions) => {\n return callRuntimeMethod(\"parameter\", name, value, options);\n};\n\nexport const description = (markdown: string) => {\n return callRuntimeMethod(\"description\", markdown);\n};\n\nexport const descriptionHtml = (html: string) => {\n return callRuntimeMethod(\"descriptionHtml\", html);\n};\n\nexport const displayName = (name: string) => {\n return callRuntimeMethod(\"displayName\", name);\n};\n\nexport const historyId = (value: string) => {\n return callRuntimeMethod(\"historyId\", value);\n};\n\nexport const testCaseId = (value: string) => {\n return callRuntimeMethod(\"testCaseId\", value);\n};\n\nexport const attachment = (\n name: string,\n content: Buffer | Uint8Array | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachment\", name, content, opts);\n};\n\nexport const globalAttachment = (\n name: string,\n content: Buffer | Uint8Array | string,\n options: ContentType | string | AttachmentOptions,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachment\", name, content, opts);\n};\n\nexport const globalAttachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"globalAttachmentFromPath\", name, path, opts);\n};\n\nexport const globalError = (details: StatusDetails) => {\n return callRuntimeMethod(\"globalError\", details);\n};\n\nexport const attachTrace = (name: string, path: string) => {\n return callRuntimeMethod(\"attachmentFromPath\", name, path, {\n contentType: \"application/vnd.allure.playwright-trace\",\n });\n};\n\nexport const attachmentPath = (\n name: string,\n path: string,\n options: ContentType | string | Omit<AttachmentOptions, \"encoding\">,\n) => {\n const opts = typeof options === \"string\" ? { contentType: options } : options;\n return callRuntimeMethod(\"attachmentFromPath\", name, path, opts);\n};\n\nexport type StepContext = {\n displayName: (name: string) => void | PromiseLike<void>;\n parameter: (name: string, value: string, mode?: ParameterMode) => void | PromiseLike<void>;\n};\n\nconst stepContext: () => StepContext = () => ({\n displayName: (name: string) => {\n return callRuntimeMethod(\"stepDisplayName\", name);\n },\n parameter: (name, value, mode?) => {\n return callRuntimeMethod(\"stepParameter\", name, value, mode);\n },\n});\n\nexport const logStep = (name: string, status?: Status, error?: Error): PromiseLike<void> => {\n return callRuntimeMethod(\"logStep\", name, status, error);\n};\n\nexport const step = <T = void>(name: string, body: (context: StepContext) => T | PromiseLike<T>): PromiseLike<T> => {\n return callRuntimeMethod(\"step\", name, () => body(stepContext()));\n};\n\nexport const issue = (url: string, name?: string) => link(url, name, LinkType.ISSUE);\n\nexport const tms = (url: string, name?: string) => link(url, name, LinkType.TMS);\n\nexport const allureId = (value: string) => label(LabelName.ALLURE_ID, value);\n\nexport const epic = (name: string) => label(LabelName.EPIC, name);\n\nexport const feature = (name: string) => label(LabelName.FEATURE, name);\n\nexport const story = (name: string) => label(LabelName.STORY, name);\n\nexport const suite = (name: string) => label(LabelName.SUITE, name);\n\nexport const parentSuite = (name: string) => label(LabelName.PARENT_SUITE, name);\n\nexport const subSuite = (name: string) => label(LabelName.SUB_SUITE, name);\n\nexport const owner = (name: string) => label(LabelName.OWNER, name);\n\nexport const severity = (name: string) => label(LabelName.SEVERITY, name);\n\nexport const layer = (name: string) => label(LabelName.LAYER, name);\n\nexport const tag = (name: string) => label(LabelName.TAG, name);\n\nexport const tags = (...tagsList: string[]) => {\n return callRuntimeMethod(\"labels\", ...tagsList.map((value) => ({ name: LabelName.TAG, value })));\n};\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA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87
  return _utils.stripAnsi;
88
88
  }
89
89
  });
90
+ Object.defineProperty(exports, "uint8ArrayToBase64", {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _utils.uint8ArrayToBase64;
94
+ }
95
+ });
90
96
  var _utils = require("./utils.js");
91
97
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_utils","require"],"sources":["../../../src/sdk/index.ts"],"sourcesContent":["export type {\n AllureResults,\n Category,\n EnvironmentInfo,\n ExecutorInfo,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n TestPlanV1Test,\n TestPlanV1,\n} from \"./types.js\";\nexport {\n getStatusFromError,\n getMessageAndTraceFromError,\n isMetadataTag,\n getMetadataLabel,\n extractMetadataFromString,\n isAllStepsEnded,\n isAnyStepFailed,\n getUnfinishedStepsMessages,\n hasStepMessage,\n isGlobalRuntimeMessage,\n isPromise,\n hasLabel,\n stripAnsi,\n serialize,\n} from \"./utils.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_utils","require"],"sources":["../../../src/sdk/index.ts"],"sourcesContent":["export type {\n AllureResults,\n Category,\n EnvironmentInfo,\n ExecutorInfo,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n TestPlanV1Test,\n TestPlanV1,\n} from \"./types.js\";\nexport {\n getStatusFromError,\n getMessageAndTraceFromError,\n isMetadataTag,\n getMetadataLabel,\n extractMetadataFromString,\n isAllStepsEnded,\n isAnyStepFailed,\n getUnfinishedStepsMessages,\n hasStepMessage,\n isGlobalRuntimeMessage,\n isPromise,\n hasLabel,\n stripAnsi,\n serialize,\n uint8ArrayToBase64,\n} from \"./utils.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAAA,MAAA,GAAAC,OAAA","ignoreList":[]}
@@ -7,9 +7,9 @@ exports.ShallowStepsStack = exports.ReporterRuntime = exports.DefaultStepStack =
7
7
  var _nodePath = _interopRequireDefault(require("node:path"));
8
8
  var _path = require("path");
9
9
  var _model = require("../../model.js");
10
+ var _factory = require("./factory.js");
10
11
  var _LifecycleState = require("./LifecycleState.js");
11
12
  var _Notifier = require("./Notifier.js");
12
- var _factory = require("./factory.js");
13
13
  var _testplan = require("./testplan.js");
14
14
  var _utils = require("./utils.js");
15
15
  var _attachments = require("./utils/attachments.js");
@@ -1 +1 @@
1
- {"version":3,"file":"ReporterRuntime.js","names":["_nodePath","_interopRequireDefault","require","_path","_model","_LifecycleState","_Notifier","_factory","_testplan","_utils","_attachments","_loader","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","set","has","TypeError","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","_classPrivateGetter","s","_assertClassBrand","_classPrivateFieldGet","get","n","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","currentStep","_get_currentStep","startStep","step","stepResult","createStepResult","steps","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","found","addAttachment","attachment","writer","isPath","path","fileExt","extname","fileName","buildAttachmentFileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","exports","_this","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_handleGlobalAttachmentContentMessage","_handleGlobalAttachmentPathMessage","_handleGlobalErrorMessage","_findParent","_writeAttachmentFile","_createAttachment","_createGlobalAttachment","_writeGlobals","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","randomUuid","state","setScope","scope","getScope","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","Stage","FINISHED","scopeUuids","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","wrapInStep","timestamp","name","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","source","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","status","statusDetails","Buffer","from","content","encoding","attachmentContent","attachmentSource","errors","_message$fileExtensio","root","getExecutionItem","globals","writeGlobals","_ref2","writtenFixtures","Set","deleteFixtureResult","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","Array","isArray","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Globals,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = stop ?? result.start ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = this.#writeAttachmentFile(attachmentContentOrPath, {\n ...options,\n fileExtension: options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined),\n });\n const attachment = this.#createAttachment(attachmentName, options.contentType, attachmentFileName);\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n return;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n return;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n applyGlobalRuntimeMessages = (messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n break;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n break;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n break;\n default:\n break;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleGlobalAttachmentContentMessage = (message: RuntimeGlobalAttachmentContentMessage[\"data\"]) => {\n const attachmentContent = Buffer.from(message.content, message.encoding);\n const attachmentSource = this.#writeAttachmentFile(attachmentContent, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalAttachmentPathMessage = (message: RuntimeGlobalAttachmentPathMessage[\"data\"]) => {\n const attachmentSource = this.#writeAttachmentFile(message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension ?? extname(message.path),\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalErrorMessage = (message: RuntimeGlobalErrorMessage[\"data\"]) => {\n this.#writeGlobals({\n attachments: [],\n errors: [{ ...message, timestamp: Date.now() }],\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeAttachmentFile = (\n attachmentContentOrPath: Buffer | string,\n options: Pick<AttachmentOptions, \"contentType\" | \"fileExtension\">,\n ) => {\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n return attachmentFileName;\n };\n\n #createAttachment = (name: string, contentType: string, source: string): Attachment => ({\n name,\n source,\n type: contentType,\n });\n\n #createGlobalAttachment = (name: string, contentType: string, source: string): Globals[\"attachments\"][number] => ({\n ...this.#createAttachment(name, contentType, source),\n timestamp: Date.now(),\n });\n\n #writeGlobals = (globals: Globals): void => {\n this.writer.writeGlobals(`${randomUuid()}-globals.json`, globals);\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAwBA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AASA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAAmD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAA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AAC,MAAM,IAAI1H,MAAM,CAACC,IAAI,CAACyH,YAAY,CAAC,CAAC/G,MAAM,EAAE;MAC3C,IAAI,CAAC+G,YAAY,GAAG1H,MAAM,CAACuP,OAAO,CAAC7H,YAAY,CAAC,CAAC8H,OAAO,CAACC,KAAA,IAAmB;QAAA,IAAlB,CAACrD,IAAI,EAAE1K,KAAK,CAAC,GAAA+N,KAAA;QACrE,IAAIJ,KAAK,CAACC,OAAO,CAAC5N,KAAK,CAAC,EAAE;UACxB,OAAOA,KAAK,CAAC8K,GAAG,CAAEkD,CAAC,KAAM;YAAEtD,IAAI;YAAE1K,KAAK,EAAEgO;UAAE,CAAC,CAAC,CAAC;QAC/C;QAEA,OAAO;UACLtD,IAAI;UACJ1K;QACF,CAAC;MACH,CAAC,CAAC;IACJ;EACF;AA8oBF;AAAC2D,OAAA,CAAA8B,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"file":"ReporterRuntime.js","names":["_nodePath","_interopRequireDefault","require","_path","_model","_factory","_LifecycleState","_Notifier","_testplan","_utils","_attachments","_loader","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_classPrivateMethodInitSpec","a","_checkPrivateRedeclaration","add","_classPrivateFieldInitSpec","set","has","TypeError","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","String","Number","_classPrivateGetter","s","_assertClassBrand","_classPrivateFieldGet","get","n","_runningSteps","WeakMap","_ShallowStepsStack_brand","WeakSet","ShallowStepsStack","constructor","currentStep","_get_currentStep","startStep","step","stepResult","createStepResult","steps","updateStep","updateFunc","console","error","stopStep","opts","stop","duration","result","start","undefined","pop","findStepByUuid","uuid","findRecursively","found","addAttachment","attachment","writer","isPath","path","fileExt","extname","fileName","buildAttachmentFileName","contentType","fileExtension","writeAttachmentFromPath","body","writeAttachment","exports","_this","DefaultStepStack","Map","stepsByRoot","clear","rootsByStep","rootUuid","maybeValue","delete","stepUuid","removeStep","newValue","_handleMetadataMessage","_handleStepMetadataMessage","_handleStartStepMessage","_handleStopStepMessage","_handleAttachmentContentMessage","_handleAttachmentPathMessage","_handleGlobalAttachmentContentMessage","_handleGlobalAttachmentPathMessage","_handleGlobalErrorMessage","_findParent","_writeAttachmentFile","_createAttachment","_createGlobalAttachment","_writeGlobals","_writeFixturesOfScope","_writeContainer","_calculateTimings","ReporterRuntime","_ref","_this2","listeners","environmentInfo","categories","links","globalLabels","LifecycleState","randomUuid","state","setScope","scope","getScope","concat","deleteScope","scopeUuid","type","fixtureResult","wrappedFixture","setFixtureResult","createFixtureResult","Date","now","fixtures","fixture","getFixtureResult","startStop","stage","Stage","FINISHED","scopeUuids","testResult","createTestResult","deepClone","notifier","beforeTestResultStart","tests","setTestResult","afterTestResultStart","getTestResult","beforeTestResultUpdate","afterTestResultUpdate","_testResult$testCaseI","_testResult$historyId","wrapped","getWrappedTestResult","beforeTestResultStop","labels","parameters","description","_testResult$descripti","descriptionHtml","_testResult$descripti2","testCaseId","getTestResultTestCaseId","historyId","getTestResultHistoryId","afterTestResultStop","hasSkipLabel","deleteTestResult","beforeTestResultWrite","writeResult","afterTestResultWrite","stepStack","parentStepUuid","parent","JSON","stringify","setStepResult","addStep","getStepResult","beforeStepStop","afterStepStop","attachmentName","attachmentContentOrPath","options","_options$fileExtensio","attachmentFileName","wrapInStep","timestamp","name","attachments","writeEnvironmentInfo","serializedCategories","map","c","messageRegex","RegExp","source","traceRegex","writeCategoriesDefinitions","messages","message","data","getWrappedFixtureResult","displayName","updateFixture","updateScope","linkConfig","formatLinks","updateTest","status","statusDetails","Buffer","from","content","encoding","attachmentContent","attachmentSource","errors","_message$fileExtensio","root","getExecutionItem","globals","writeGlobals","_ref2","writtenFixtures","Set","deleteFixtureResult","befores","afters","writeGroup","children","normalisedDuration","Math","max","round","resolveWriter","Notifier","Array","isArray","entries","flatMap","_ref3","v"],"sources":["../../../../src/sdk/reporter/ReporterRuntime.ts"],"sourcesContent":["/* eslint max-lines: 0 */\nimport path from \"node:path\";\nimport { extname } from \"path\";\n\nimport {\n type Attachment,\n type AttachmentOptions,\n type FixtureResult,\n type Globals,\n type Label,\n Stage,\n type StepResult,\n type TestResult,\n} from \"../../model.js\";\nimport type {\n Category,\n EnvironmentInfo,\n RuntimeAttachmentContentMessage,\n RuntimeAttachmentPathMessage,\n RuntimeGlobalAttachmentContentMessage,\n RuntimeGlobalAttachmentPathMessage,\n RuntimeGlobalErrorMessage,\n RuntimeMessage,\n RuntimeMetadataMessage,\n RuntimeStartStepMessage,\n RuntimeStepMetadataMessage,\n RuntimeStopStepMessage,\n} from \"../types.js\";\nimport { createFixtureResult, createStepResult, createTestResult } from \"./factory.js\";\nimport { LifecycleState } from \"./LifecycleState.js\";\nimport { Notifier } from \"./Notifier.js\";\nimport { hasSkipLabel } from \"./testplan.js\";\nimport type {\n FixtureResultWrapper,\n FixtureType,\n LinkConfig,\n ReporterRuntimeConfig,\n TestScope,\n Writer,\n} from \"./types.js\";\nimport { deepClone, formatLinks, getTestResultHistoryId, getTestResultTestCaseId, randomUuid } from \"./utils.js\";\nimport { buildAttachmentFileName } from \"./utils/attachments.js\";\nimport { resolveWriter } from \"./writer/loader.js\";\n\nexport interface StepStack {\n clear(): void;\n\n removeRoot(rootUuid: string): void;\n\n currentStep(rootUuid: string): string | undefined;\n\n addStep(rootUuid: string, stepUuid: string): void;\n\n removeStep(stepUuid: string): void;\n}\n\n/**\n * Simpler steps stack implementation that contains only the current steps without root nodes\n * Useful, when you need to create steps without binding them to a specific test or fixture\n * @example\n * ```js\n * const stack = new ShallowStepsStack();\n *\n * stack.startStep({ name: \"step 1\" });\n * stack.startStep({ name: \"step 1.1\" });\n * stack.stopStep({ status: Status.FAILED });\n * stack.stopStep({ status: Status.PASSED });\n * stack.steps // => [{ name: \"step 1\", status: Status.PASSED, steps: [{ name: \"step 1.1\", status: Status.FAILED }] }]\n * ```\n */\nexport class ShallowStepsStack {\n steps: StepResult[] = [];\n\n #runningSteps: StepResult[] = [];\n\n get #currentStep() {\n return this.#runningSteps[this.#runningSteps.length - 1];\n }\n\n currentStep() {\n return this.#currentStep;\n }\n\n startStep(step: Partial<StepResult>) {\n const stepResult: StepResult = {\n ...createStepResult(),\n ...step,\n };\n\n if (this.#currentStep) {\n this.#currentStep.steps.push(stepResult);\n } else {\n this.steps.push(stepResult);\n }\n\n this.#runningSteps.push(stepResult);\n }\n\n updateStep(updateFunc: (result: StepResult) => void) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to update!\");\n return;\n }\n\n updateFunc(this.#currentStep);\n }\n\n stopStep(opts?: { stop?: number; duration?: number }) {\n if (!this.#currentStep) {\n // eslint-disable-next-line no-console\n console.error(\"There is no running step in the stack to stop!\");\n return;\n }\n\n const { stop, duration = 0 } = opts ?? {};\n\n this.updateStep((result) => {\n result.stop = (stop ?? result.start) ? result.start! + duration : undefined;\n });\n\n this.#runningSteps.pop();\n }\n\n findStepByUuid(uuid: string): StepResult | undefined {\n const findRecursively = (steps: StepResult[]): StepResult | undefined => {\n for (const s of steps) {\n if (s.uuid === uuid) {\n return s;\n }\n const found = findRecursively(s.steps);\n if (found) {\n return found;\n }\n }\n return undefined;\n };\n return findRecursively(this.steps);\n }\n\n addAttachment(attachment: AttachmentOptions, writer: Writer) {\n const isPath = !!attachment.path;\n const fileExt = attachment.path ? path.extname(attachment.path) : undefined;\n const fileName = buildAttachmentFileName({\n contentType: attachment.contentType,\n fileExtension: fileExt,\n });\n if (isPath) {\n writer.writeAttachmentFromPath(fileName, attachment.path as string);\n } else if (attachment.body) {\n writer.writeAttachment(fileName, attachment.body);\n }\n return fileName;\n }\n}\n\nexport class DefaultStepStack implements StepStack {\n private stepsByRoot: Map<string, string[]> = new Map();\n private rootsByStep: Map<string, string> = new Map();\n\n clear = (): void => {\n this.stepsByRoot.clear();\n this.rootsByStep.clear();\n };\n\n removeRoot = (rootUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n this.stepsByRoot.delete(rootUuid);\n if (maybeValue) {\n maybeValue.forEach((stepUuid) => this.rootsByStep.delete(stepUuid));\n }\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n return maybeValue[maybeValue.length - 1];\n };\n\n addStep = (rootUuid: string, stepUuid: string): void => {\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n this.stepsByRoot.set(rootUuid, [stepUuid]);\n } else {\n maybeValue.push(stepUuid);\n }\n this.rootsByStep.set(stepUuid, rootUuid);\n };\n\n removeStep(stepUuid: string) {\n const rootUuid = this.rootsByStep.get(stepUuid);\n if (!rootUuid) {\n return;\n }\n const maybeValue = this.stepsByRoot.get(rootUuid);\n if (!maybeValue) {\n return;\n }\n const newValue = maybeValue.filter((value) => value !== stepUuid);\n this.stepsByRoot.set(rootUuid, newValue);\n }\n}\n\nexport class ReporterRuntime {\n private readonly state = new LifecycleState();\n private notifier: Notifier;\n private stepStack: StepStack = new DefaultStepStack();\n writer: Writer;\n categories?: Category[];\n environmentInfo?: EnvironmentInfo;\n linkConfig?: LinkConfig;\n globalLabels: Label[] = [];\n\n constructor({\n writer,\n listeners = [],\n environmentInfo,\n categories,\n links,\n globalLabels = {},\n }: ReporterRuntimeConfig) {\n this.writer = resolveWriter(writer);\n this.notifier = new Notifier({ listeners });\n this.categories = categories;\n this.environmentInfo = environmentInfo;\n this.linkConfig = links;\n\n if (Array.isArray(globalLabels)) {\n this.globalLabels = globalLabels;\n } else if (Object.keys(globalLabels).length) {\n this.globalLabels = Object.entries(globalLabels).flatMap(([name, value]) => {\n if (Array.isArray(value)) {\n return value.map((v) => ({ name, value: v }));\n }\n\n return {\n name,\n value,\n };\n });\n }\n }\n\n startScope = (): string => {\n const uuid = randomUuid();\n this.state.setScope(uuid);\n return uuid;\n };\n\n updateScope = (uuid: string, updateFunc: (scope: TestScope) => void): void => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not update scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(scope);\n };\n\n writeScope = (uuid: string) => {\n const scope = this.state.getScope(uuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not write scope: no scope with uuid ${uuid} is found`);\n return;\n }\n\n this.#writeFixturesOfScope(scope);\n this.state.deleteScope(scope.uuid);\n };\n\n startFixture = (scopeUuid: string, type: FixtureType, fixtureResult: Partial<FixtureResult>): string | undefined => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not start fixture: no scope with uuid ${scopeUuid} is found`);\n return;\n }\n\n const uuid = randomUuid();\n const wrappedFixture = this.state.setFixtureResult(scopeUuid, uuid, type, {\n ...createFixtureResult(),\n start: Date.now(),\n ...fixtureResult,\n });\n\n scope.fixtures.push(wrappedFixture);\n return uuid;\n };\n\n updateFixture = (uuid: string, updateFunc: (result: FixtureResult) => void): void => {\n const fixture = this.state.getFixtureResult(uuid);\n\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not update fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(fixture);\n };\n\n stopFixture = (uuid: string, opts?: { stop?: number; duration?: number }): void => {\n const fixture = this.state.getFixtureResult(uuid);\n if (!fixture) {\n // eslint-disable-next-line no-console\n console.error(`could not stop fixture: no fixture with uuid ${uuid} is found`);\n return;\n }\n\n const startStop = this.#calculateTimings(fixture.start, opts?.stop, opts?.duration);\n fixture.start = startStop.start;\n fixture.stop = startStop.stop;\n\n fixture.stage = Stage.FINISHED;\n };\n\n startTest = (result: Partial<TestResult>, scopeUuids: string[] = []): string => {\n const uuid = randomUuid();\n const testResult: TestResult = {\n ...createTestResult(uuid),\n start: Date.now(),\n ...deepClone(result),\n };\n\n this.notifier.beforeTestResultStart(testResult);\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n if (!scope) {\n // eslint-disable-next-line no-console\n console.error(`count not link test to the scope: no scope with uuid ${uuid} is found`);\n return;\n }\n scope.tests.push(uuid);\n });\n\n this.state.setTestResult(uuid, testResult, scopeUuids);\n this.notifier.afterTestResultStart(testResult);\n return uuid;\n };\n\n updateTest = (uuid: string, updateFunc: (result: TestResult) => void): void => {\n const testResult = this.state.getTestResult(uuid);\n\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not update test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n this.notifier.beforeTestResultUpdate(testResult);\n updateFunc(testResult);\n this.notifier.afterTestResultUpdate(testResult);\n };\n\n stopTest = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const wrapped = this.state.getWrappedTestResult(uuid);\n if (!wrapped) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test result: no test with uuid ${uuid}) is found`);\n return;\n }\n\n const testResult = wrapped.value;\n\n this.notifier.beforeTestResultStop(testResult);\n\n const scopeUuids = wrapped.scopeUuids;\n\n scopeUuids.forEach((scopeUuid) => {\n const scope = this.state.getScope(scopeUuid);\n\n if (scope?.labels) {\n testResult.labels = [...testResult.labels, ...scope.labels];\n }\n\n if (scope?.links) {\n testResult.links = [...testResult.links, ...scope.links];\n }\n\n if (scope?.parameters) {\n testResult.parameters = [...testResult.parameters, ...scope.parameters];\n }\n\n if (scope?.description) {\n testResult.description = testResult.description ?? scope.description;\n }\n\n if (scope?.descriptionHtml) {\n testResult.descriptionHtml = testResult.descriptionHtml ?? scope.descriptionHtml;\n }\n });\n\n testResult.labels = [...this.globalLabels, ...testResult.labels];\n\n testResult.testCaseId ??= getTestResultTestCaseId(testResult);\n testResult.historyId ??= getTestResultHistoryId(testResult);\n\n const startStop = this.#calculateTimings(testResult.start, opts?.stop, opts?.duration);\n\n testResult.start = startStop.start;\n testResult.stop = startStop.stop;\n\n this.notifier.afterTestResultStop(testResult);\n };\n\n writeTest = (uuid: string) => {\n const testResult = this.state.getTestResult(uuid);\n if (!testResult) {\n // eslint-disable-next-line no-console\n console.error(`could not write test result: no test with uuid ${uuid} is found`);\n return;\n }\n\n if (hasSkipLabel(testResult.labels)) {\n this.state.deleteTestResult(uuid);\n return;\n }\n\n this.notifier.beforeTestResultWrite(testResult);\n\n this.writer.writeResult(testResult);\n this.state.deleteTestResult(uuid);\n\n this.notifier.afterTestResultWrite(testResult);\n };\n\n currentStep = (rootUuid: string): string | undefined => {\n return this.stepStack.currentStep(rootUuid);\n };\n\n startStep = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n result: Partial<StepResult>,\n ): string | undefined => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not start test step: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n const stepResult: StepResult = {\n ...createStepResult(),\n start: Date.now(),\n ...result,\n };\n parent.steps.push(stepResult);\n const stepUuid = randomUuid();\n this.state.setStepResult(stepUuid, stepResult);\n\n this.stepStack.addStep(rootUuid, stepUuid);\n\n return stepUuid;\n };\n\n updateStep = (uuid: string, updateFunc: (stepResult: StepResult) => void) => {\n const step = this.state.getStepResult(uuid)!;\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not update test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n updateFunc(step);\n };\n\n stopStep = (uuid: string, opts?: { stop?: number; duration?: number }) => {\n const step = this.state.getStepResult(uuid);\n if (!step) {\n // eslint-disable-next-line no-console\n console.error(`could not stop test step: no step with uuid ${uuid} is found`);\n return;\n }\n\n this.notifier.beforeStepStop(step);\n\n const startStop = this.#calculateTimings(step.start, opts?.stop, opts?.duration);\n step.start = startStop.start;\n step.stop = startStop.stop;\n\n step.stage = Stage.FINISHED;\n\n this.stepStack.removeStep(uuid);\n\n this.notifier.afterStepStop(step);\n };\n\n writeAttachment = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n attachmentName: string,\n attachmentContentOrPath: Buffer | string,\n options: AttachmentOptions & { wrapInStep?: boolean; timestamp?: number },\n ) => {\n const parent = this.#findParent(rootUuid, parentStepUuid);\n if (!parent) {\n // eslint-disable-next-line no-console\n console.error(\n `could not write test attachment: no context for root ${rootUuid} and parentStepUuid ${JSON.stringify(parentStepUuid)} is found`,\n );\n return;\n }\n\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = this.#writeAttachmentFile(attachmentContentOrPath, {\n ...options,\n fileExtension: options.fileExtension ?? (isPath ? extname(attachmentContentOrPath) : undefined),\n });\n const attachment = this.#createAttachment(attachmentName, options.contentType, attachmentFileName);\n\n if (options.wrapInStep) {\n const { timestamp = Date.now() } = options;\n parent.steps.push({\n name: attachmentName,\n attachments: [attachment],\n start: timestamp,\n stop: timestamp,\n } as StepResult);\n } else {\n parent.attachments.push(attachment);\n }\n };\n\n writeEnvironmentInfo = () => {\n if (!this.environmentInfo) {\n return;\n }\n\n this.writer.writeEnvironmentInfo(this.environmentInfo);\n };\n\n writeCategoriesDefinitions = () => {\n if (!this.categories) {\n return;\n }\n\n const serializedCategories = this.categories.map((c) => {\n if (c.messageRegex instanceof RegExp) {\n c.messageRegex = c.messageRegex.source;\n }\n\n if (c.traceRegex instanceof RegExp) {\n c.traceRegex = c.traceRegex.source;\n }\n\n return c;\n });\n\n this.writer.writeCategoriesDefinitions(serializedCategories);\n };\n\n applyRuntimeMessages = (rootUuid: string, messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"metadata\":\n this.#handleMetadataMessage(rootUuid, message.data);\n return;\n case \"step_metadata\":\n this.#handleStepMetadataMessage(rootUuid, message.data);\n return;\n case \"step_start\":\n this.#handleStartStepMessage(rootUuid, message.data);\n return;\n case \"step_stop\":\n this.#handleStopStepMessage(rootUuid, message.data);\n return;\n case \"attachment_content\":\n this.#handleAttachmentContentMessage(rootUuid, message.data);\n return;\n case \"attachment_path\":\n this.#handleAttachmentPathMessage(rootUuid, message.data);\n return;\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n return;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n return;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n return;\n default:\n // eslint-disable-next-line no-console\n console.error(`could not apply runtime messages: unknown message ${JSON.stringify(message)}`);\n return;\n }\n });\n };\n\n applyGlobalRuntimeMessages = (messages: RuntimeMessage[]) => {\n messages.forEach((message) => {\n switch (message.type) {\n case \"global_attachment_content\":\n this.#handleGlobalAttachmentContentMessage(message.data);\n break;\n case \"global_attachment_path\":\n this.#handleGlobalAttachmentPathMessage(message.data);\n break;\n case \"global_error\":\n this.#handleGlobalErrorMessage(message.data);\n break;\n default:\n break;\n }\n });\n };\n\n #handleMetadataMessage = (rootUuid: string, message: RuntimeMetadataMessage[\"data\"]) => {\n // only display name could be set to fixture.\n const fixtureResult = this.state.getWrappedFixtureResult(rootUuid);\n const { links, labels, parameters, displayName, testCaseId, historyId, description, descriptionHtml } = message;\n\n if (fixtureResult) {\n if (displayName) {\n this.updateFixture(rootUuid, (result) => {\n result.name = displayName;\n });\n }\n\n if (historyId) {\n // eslint-disable-next-line no-console\n console.error(\"historyId can't be changed within test fixtures\");\n }\n if (testCaseId) {\n // eslint-disable-next-line no-console\n console.error(\"testCaseId can't be changed within test fixtures\");\n }\n\n if (links || labels || parameters || description || descriptionHtml) {\n // in some frameworks, afterEach methods can be executed before test stop event, while\n // in others after. To remove the possible undetermined behaviour we only allow\n // using runtime metadata API in before hooks.\n if (fixtureResult.type === \"after\") {\n // eslint-disable-next-line no-console\n console.error(\"metadata messages isn't supported for after test fixtures\");\n return;\n }\n\n this.updateScope(fixtureResult.scopeUuid, (scope) => {\n if (links) {\n scope.links = [...scope.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n scope.labels = [...scope.labels, ...labels];\n }\n if (parameters) {\n scope.parameters = [...scope.parameters, ...parameters];\n }\n if (description) {\n scope.description = description;\n }\n if (descriptionHtml) {\n scope.descriptionHtml = descriptionHtml;\n }\n });\n }\n\n return;\n }\n\n this.updateTest(rootUuid, (result) => {\n if (links) {\n result.links = [...result.links, ...(this.linkConfig ? formatLinks(this.linkConfig, links) : links)];\n }\n if (labels) {\n result.labels = [...result.labels, ...labels];\n }\n if (parameters) {\n result.parameters = [...result.parameters, ...parameters];\n }\n if (displayName) {\n result.name = displayName;\n }\n if (testCaseId) {\n result.testCaseId = testCaseId;\n }\n if (historyId) {\n result.historyId = historyId;\n }\n if (description) {\n result.description = description;\n }\n if (descriptionHtml) {\n result.descriptionHtml = descriptionHtml;\n }\n });\n };\n\n #handleStepMetadataMessage = (rootUuid: string, message: RuntimeStepMetadataMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step metadata message: no step is running\");\n return;\n }\n const { name, parameters } = message;\n this.updateStep(stepUuid, (stepResult) => {\n if (name) {\n stepResult.name = name;\n }\n if (parameters) {\n stepResult.parameters = [...stepResult.parameters, ...parameters];\n }\n });\n };\n\n #handleStartStepMessage = (rootUuid: string, message: RuntimeStartStepMessage[\"data\"]) => {\n this.startStep(rootUuid, undefined, { ...message });\n };\n\n #handleStopStepMessage = (rootUuid: string, message: RuntimeStopStepMessage[\"data\"]) => {\n const stepUuid = this.currentStep(rootUuid);\n if (!stepUuid) {\n // eslint-disable-next-line no-console\n console.error(\"could not handle step stop message: no step is running\");\n return;\n }\n this.updateStep(stepUuid, (result) => {\n if (message.status && !result.status) {\n result.status = message.status;\n }\n if (message.statusDetails) {\n result.statusDetails = { ...result.statusDetails, ...message.statusDetails };\n }\n });\n this.stopStep(stepUuid, { stop: message.stop });\n };\n\n #handleAttachmentContentMessage = (rootUuid: string, message: RuntimeAttachmentContentMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, Buffer.from(message.content, message.encoding), {\n encoding: message.encoding,\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleAttachmentPathMessage = (rootUuid: string, message: RuntimeAttachmentPathMessage[\"data\"]) => {\n this.writeAttachment(rootUuid, undefined, message.name, message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n wrapInStep: message.wrapInStep,\n timestamp: message.timestamp,\n });\n };\n\n #handleGlobalAttachmentContentMessage = (message: RuntimeGlobalAttachmentContentMessage[\"data\"]) => {\n const attachmentContent = Buffer.from(message.content, message.encoding);\n const attachmentSource = this.#writeAttachmentFile(attachmentContent, {\n contentType: message.contentType,\n fileExtension: message.fileExtension,\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalAttachmentPathMessage = (message: RuntimeGlobalAttachmentPathMessage[\"data\"]) => {\n const attachmentSource = this.#writeAttachmentFile(message.path, {\n contentType: message.contentType,\n fileExtension: message.fileExtension ?? extname(message.path),\n });\n\n this.#writeGlobals({\n attachments: [this.#createGlobalAttachment(message.name, message.contentType, attachmentSource)],\n errors: [],\n });\n };\n\n #handleGlobalErrorMessage = (message: RuntimeGlobalErrorMessage[\"data\"]) => {\n this.#writeGlobals({\n attachments: [],\n errors: [{ ...message, timestamp: Date.now() }],\n });\n };\n\n #findParent = (\n rootUuid: string,\n parentStepUuid: string | null | undefined,\n ): FixtureResult | TestResult | StepResult | undefined => {\n const root = this.state.getExecutionItem(rootUuid);\n if (!root) {\n return;\n }\n\n if (parentStepUuid === null) {\n return root;\n } else if (parentStepUuid === undefined) {\n const stepUuid = this.currentStep(rootUuid);\n return stepUuid ? this.state.getStepResult(stepUuid) : root;\n } else {\n return this.state.getStepResult(parentStepUuid);\n }\n };\n\n #writeAttachmentFile = (\n attachmentContentOrPath: Buffer | string,\n options: Pick<AttachmentOptions, \"contentType\" | \"fileExtension\">,\n ) => {\n const isPath = typeof attachmentContentOrPath === \"string\";\n const attachmentFileName = buildAttachmentFileName({\n contentType: options.contentType,\n fileExtension: options.fileExtension,\n });\n\n if (isPath) {\n this.writer.writeAttachmentFromPath(attachmentFileName, attachmentContentOrPath);\n } else {\n this.writer.writeAttachment(attachmentFileName, attachmentContentOrPath);\n }\n\n return attachmentFileName;\n };\n\n #createAttachment = (name: string, contentType: string, source: string): Attachment => ({\n name,\n source,\n type: contentType,\n });\n\n #createGlobalAttachment = (name: string, contentType: string, source: string): Globals[\"attachments\"][number] => ({\n ...this.#createAttachment(name, contentType, source),\n timestamp: Date.now(),\n });\n\n #writeGlobals = (globals: Globals): void => {\n this.writer.writeGlobals(`${randomUuid()}-globals.json`, globals);\n };\n\n #writeFixturesOfScope = ({ fixtures, tests }: TestScope) => {\n const writtenFixtures = new Set<string>();\n if (tests.length) {\n for (const wrappedFixture of fixtures) {\n if (!writtenFixtures.has(wrappedFixture.uuid)) {\n this.#writeContainer(tests, wrappedFixture);\n this.state.deleteFixtureResult(wrappedFixture.uuid);\n writtenFixtures.add(wrappedFixture.uuid);\n }\n }\n }\n };\n\n #writeContainer = (tests: string[], wrappedFixture: FixtureResultWrapper) => {\n const fixture = wrappedFixture.value;\n const befores = wrappedFixture.type === \"before\" ? [wrappedFixture.value] : [];\n const afters = wrappedFixture.type === \"after\" ? [wrappedFixture.value] : [];\n this.writer.writeGroup({\n uuid: wrappedFixture.uuid,\n name: fixture.name,\n children: [...new Set(tests)],\n befores,\n afters,\n });\n };\n\n #calculateTimings = (\n start?: number,\n stop?: number,\n duration?: number,\n ): {\n start?: number;\n stop?: number;\n } => {\n const result: { start?: number; stop?: number } = { start, stop };\n if (duration) {\n const normalisedDuration = Math.max(0, duration);\n if (result.stop !== undefined) {\n result.start = result.stop - normalisedDuration;\n } else if (result.start !== undefined) {\n result.stop = result.start + normalisedDuration;\n } else {\n result.stop = Date.now();\n result.start = result.stop - normalisedDuration;\n }\n } else {\n if (result.stop === undefined) {\n result.stop = Date.now();\n }\n if (result.start === undefined) {\n result.start = result.stop;\n }\n }\n return {\n start: result.start ? Math.round(result.start) : undefined,\n stop: result.stop ? Math.round(result.stop) : undefined,\n };\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAwBA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AASA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAAmD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAR,CAAA,GAAAI,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAX,CAAA,EAAAI,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAf,CAAA,aAAAI,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAD,OAAA,CAAAG,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,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