-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
787 lines (692 loc) Β· 24.1 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
/* eslint-disable @typescript-eslint/no-empty-interface */
import type {AggregatedResult, Config, TestCaseResult, TestResult} from '@jest/reporters';
import JestMetadataReporter from 'jest-metadata/reporter';
declare module 'jest-allure2-reporter' {
// region Options
export interface ReporterOptions {
/**
* Extend the base configuration with custom options.
* You can apply multiple extensions in a chain.
*/
extends?: MaybeArray<string | ReporterOptions>;
/**
* Overwrite the results directory if it already exists.
* @default true
*/
overwrite?: boolean;
/**
* Specify where to output test result files.
* Please note that the results directory is not a ready-to-view Allure report.
* You'll need to generate the report using the `allure` CLI.
*
* @default 'allure-results'
*/
resultsDir?: string;
/**
* Inject Allure's global variables into the test environment.
* Those who don't want to pollute the global scope can disable this option
* and import the `jest-allure2-reporter/api` module in their test files.
*
* @default true
*/
injectGlobals?: boolean;
/**
* Configure how external attachments are attached to the report.
*/
attachments?: AttachmentsOptions;
/**
* Tweak the way source code and docblocks are extracted from test files.
*/
sourceCode?: SourceCodeProcessorOptions;
/**
* Configures the defect categories for the report.
*
* By default, the report will have the following categories:
* `Product defects`, `Test defects` based on the test case status:
* `failed` and `broken` respectively.
*/
categories?: CategoriesCustomizer;
/**
* Configures the environment information that will be reported.
*/
environment?: EnvironmentCustomizer;
/**
* Configures the executor information that will be reported.
*/
executor?: ExecutorCustomizer;
/**
* Customize extractor helpers object to use later in the customizers.
*/
helpers?: HelpersCustomizer;
/**
* Customize how to report test runs (sessions) as pseudo-test cases.
* This is normally used to report broken global setup and teardown hooks,
* and to provide additional information about the test run.
*/
testRun?: TestCaseCustomizer<TestRunExtractorContext>;
/**
* Customize how to report test files as pseudo-test cases.
* This is normally used to report broken test files, so that you can be aware of them,
* but advanced users may find other use cases.
*/
testFile?: TestCaseCustomizer<TestFileExtractorContext>;
/**
* Customize how test cases are reported: names, descriptions, labels, status, etc.
*/
testCase?: TestCaseCustomizer<TestCaseExtractorContext>;
/**
* Customize how individual test steps are reported.
*/
testStep?: TestStepCustomizer;
}
export interface AttachmentsOptions {
/**
* Defines a subdirectory within the {@link ReporterOptions#resultsDir} where attachments will be stored.
* Use absolute path if you want to store attachments outside the {@link ReporterOptions#resultsDir} directory.
* @default 'attachments'
*/
subDir?: string;
/**
* Specifies default strategy for attaching files to the report by their path.
* - `copy` - copy the file to {@link AttachmentsOptions#subDir}
* - `move` - move the file to {@link AttachmentsOptions#subDir}
* - `ref` - use the file path as is
* @default 'ref'
* @see {@link AllureRuntime#createFileAttachment}
*/
fileHandler?: BuiltinFileAttachmentHandler | string;
/**
* Specifies default strategy for attaching dynamic content to the report.
* Uses simple file writing by default.
* @default 'write'
* @see {@link AllureRuntime#createContentAttachment}
*/
contentHandler?: BuiltinContentAttachmentHandler | string;
}
/** @see {@link AttachmentsOptions#fileHandler} */
export type BuiltinFileAttachmentHandler = 'copy' | 'move' | 'ref';
/** @see {@link AttachmentsOptions#contentHandler} */
export type BuiltinContentAttachmentHandler = 'write';
export interface SourceCodeProcessorOptions {
enabled?: boolean;
plugins?: Record<string, SourceCodePluginCustomizer | unknown | [SourceCodePluginCustomizer, unknown?]>;
}
// endregion
// region Customizers
export type SourceCodePluginCustomizer = PropertyExtractor<GlobalExtractorContext, unknown, MaybePromise<SourceCodePlugin | undefined>>;
export interface SourceCodePlugin {
readonly name: string;
extractDocblock?(context: Readonly<DocblockExtractionContext>): MaybePromise<AllureTestItemDocblock | undefined>;
extractSourceCode?(location: Readonly<AllureTestItemSourceLocation>, includeComments: boolean): MaybePromise<ExtractSourceCodeHelperResult | undefined>;
}
export interface DocblockExtractionContext extends AllureTestItemSourceLocation {
transformedCode?: string;
}
export interface TestCaseCustomizer<Context = {}> {
/**
* Extractor to generate a unique identifier for the test case file.
* Do not use it unless you need predictable JSON paths for some demo purposes.
*/
uuid?: PropertyCustomizer<Context, string>;
/**
* Extractor to omit test cases from the report.
*/
ignored?: PropertyCustomizer<Context, boolean>;
/**
* Test case ID extractor to fine-tune Allure's history feature.
* @example ({ package, file, test }) => `${package.name}:${file.path}:${test.fullName}`
* @example ({ test }) => `${test.identifier}:${test.title}`
* @see https://wix-incubator.github.io/jest-allure2-reporter/docs/config/history/#test-case-id
*/
historyId?: PropertyCustomizer<Context, Primitive>;
/**
* Extractor for the default test or step name.
* @default ({ test }) => test.title
*/
displayName?: PropertyCustomizer<Context, string>;
/**
* Extractor for the full test case name.
* @default ({ test }) => test.fullName
*/
fullName?: PropertyCustomizer<Context, string>;
/**
* Extractor for the test case start timestamp.
*/
start?: PropertyCustomizer<Context, number>;
/**
* Extractor for the test case stop timestamp.
*/
stop?: PropertyCustomizer<Context, number>;
/**
* Extractor for the test case description.
* @example ({ testCaseMetadata }) => '```js\n' + testCaseMetadata.transformedCode + '\n```'
*/
description?: PropertyCustomizer<Context, string>;
/**
* Extractor for the test case description in HTML format.
* @example ({ testCaseMetadata }) => '<pre><code>' + testCaseMetadata.transformedCode + '</code></pre>'
*/
descriptionHtml?: PropertyCustomizer<Context, string>;
/**
* Extractor for the test case stage.
*/
stage?: PropertyCustomizer<Context, Stage>;
/**
* Extractor for the test case status.
* @see https://wix-incubator.github.io/jest-allure2-reporter/docs/config/statuses/
* @example ({ value }) => value === 'broken' ? 'failed' : value
*/
status?: PropertyCustomizer<Context, Status>;
/**
* Extractor for the test case status details.
*/
statusDetails?: PropertyCustomizer<Context, MaybeNullish<StatusDetails>>;
/**
* Customize Allure labels for the test case.
*
* @example
* {
* suite: ({ file }) => file.path,
* subSuite: ({ test }) => test.ancestorTitles[0],
* }
*/
labels?: LabelsCustomizer<Context>;
/**
* Resolve issue links for the test case.
*
* @example
* {
* issue: ({ value }) => ({
* type: 'issue',
* name: value.name ?? `Open ${value.url} in JIRA`,
* url: `https://jira.company.com/${value.url}`,
* }),
* }
*/
links?: LinksCustomizer<Context>;
/**
* Customize step or test case attachments.
*/
attachments?: AttachmentsCustomizer<Context>;
/**
* Customize step or test case parameters.
*/
parameters?: ParametersCustomizer<Context>;
}
/**
* Global customizations for how test steps are reported, e.g.
* beforeAll, beforeEach, afterEach, afterAll hooks and custom steps.
*/
export interface TestStepCustomizer<Context = TestStepExtractorContext> {
/**
* Extractor to omit test steps from the report.
*/
ignored?: PropertyCustomizer<Context, boolean>;
/**
* Extractor for the step name.
* @example ({ value }) => value.replace(/(before|after)(Each|All)/, (_, p1, p2) => p1 + ' ' + p2.toLowerCase())
*/
displayName?: PropertyCustomizer<Context, string>;
/**
* Extractor for the test step start timestamp.
*/
start?: PropertyCustomizer<Context, number>;
/**
* Extractor for the test step stop timestamp.
*/
stop?: PropertyCustomizer<Context, number>;
/**
* Extractor for the test step stage.
* @see https://wix-incubator.github.io/jest-allure2-reporter/docs/config/statuses/
* @example ({ value }) => value === 'running' ? 'pending' : value
*/
stage?: PropertyCustomizer<Context, Stage>;
/**
* Extractor for the test step status.
* @see https://wix-incubator.github.io/jest-allure2-reporter/docs/config/statuses/
* @example ({ value }) => value === 'broken' ? 'failed' : value
*/
status?: PropertyCustomizer<Context, Status>;
/**
* Extractor for the test step status details.
*/
statusDetails?: PropertyCustomizer<Context, MaybeNullish<StatusDetails>>;
/**
* Customize step or test step attachments.
*/
attachments?: AttachmentsCustomizer<Context>;
/**
* Customize step or test step parameters.
*/
parameters?: ParametersCustomizer<Context>;
}
export type CategoriesCustomizer = PropertyCustomizer<GlobalExtractorContext, Category[]>;
export type EnvironmentCustomizer = PropertyCustomizer<GlobalExtractorContext, Record<string, Primitive>>;
export type ExecutorCustomizer = PropertyCustomizer<GlobalExtractorContext, ExecutorInfo>;
export type HelpersCustomizer =
| PropertyExtractor<GlobalExtractorContext, PromisedProperties<Helpers>>
| HelperCustomizersMap;
export type HelperCustomizersMap = {
[K in keyof Helpers]?: KeyedHelperCustomizer<K>;
};
export type KeyedHelperCustomizer<K extends keyof Helpers> =
PropertyExtractor<GlobalExtractorContext, MaybePromise<Helpers[K]>>;
export type AttachmentsCustomizer<Context> = PropertyCustomizer<Context, Attachment[]>;
export type LabelsCustomizer<Context> =
| PropertyCustomizer<Context, Label[]>
| Record<LabelName, KeyedLabelCustomizer<Context>>;
export type KeyedLabelCustomizer<Context> =
| MaybeNullish<MaybeArray<string>>
| KeyedLabelExtractor<Context>
export type KeyedLabelExtractor<Context> =
PropertyExtractor<
Context,
MaybeNullish<MaybeArray<string>>,
MaybePromise<MaybeNullish<MaybeArray<string>>>
>;
export type LinksCustomizer<Context> =
| PropertyCustomizer<Context, Link[]>
| Record<LinkType, KeyedLinkCustomizer<Context>>;
export type KeyedLinkCustomizer<Context> =
| MaybeNullish<string | Link | Link[]>
| KeyedLinkExtractor<Context>;
export type KeyedLinkExtractor<Context> =
PropertyExtractor<
Context,
MaybeNullish<MaybeArray<Link>>,
MaybePromise<MaybeNullish<MaybeArray<Link>>>
>;
export type ParametersCustomizer<Context> =
| PropertyCustomizer<Context, Parameter[]>
| Record<string, KeyedParameterCustomizer<Context>>;
export type KeyedParameterCustomizer<Context> = PropertyCustomizer<
Context,
Parameter,
Primitive | Partial<Parameter>
>;
export type PropertyCustomizer<Context, Value, Result = Value> = Result | PropertyExtractor<Context, MaybePromise<Value>, MaybePromise<Result>>;
// endregion
// region Extractors
export type PropertyExtractor<
Context,
Value,
Result = Value,
> = (context: PropertyExtractorContext<Context, Value>) => Result;
export type PropertyExtractorContext<Context, Value> = Readonly<Context & { value: Value }>;
export type PromisedProperties<T> = {
readonly [K in keyof T]: MaybePromise<T[K]>;
};
export interface GlobalExtractorContext {
$: Helpers;
globalConfig: Config.GlobalConfig;
reporterConfig: unknown;
}
export interface TestItemExtractorContext<Value> extends GlobalExtractorContext {
result: Partial<PromisedProperties<Value>>;
testRunMetadata: AllureTestRunMetadata;
}
export interface TestRunExtractorContext extends TestItemExtractorContext<AllureTestCaseResult> {
aggregatedResult: AggregatedResult;
}
export interface TestFileExtractorContext extends TestItemExtractorContext<AllureTestCaseResult> {
filePath: string[];
testFile: TestResult;
testFileMetadata: AllureTestFileMetadata;
}
export interface TestCaseExtractorContext extends TestItemExtractorContext<AllureTestCaseResult> {
filePath: string[];
testCase: TestCaseResult;
testCaseMetadata: AllureTestCaseMetadata;
testFileMetadata: AllureTestFileMetadata;
}
export interface TestStepExtractorContext extends TestItemExtractorContext<AllureTestStepResult> {
aggregatedResult?: AggregatedResult;
filePath?: string[];
testCase?: TestCaseResult;
testCaseMetadata?: AllureTestCaseMetadata;
testFile?: TestResult;
testFileMetadata?: AllureTestFileMetadata;
testStepMetadata: AllureTestStepMetadata;
}
export interface Helpers extends HelpersAugmentation {
/**
* Provides an optimized way to navigate through the test file content.
* Accepts a file path in a string or a split array format.
* @param filePath - the path to the file to navigate, split by directory separators or as a single string.
* @returns a file navigator object or undefined if the file is not found or cannot be read.
*/
getFileNavigator(filePath: string | string[]): Promise<FileNavigator | undefined>;
/**
* Extracts the source code of the current test case or step.
* @param location - the location of the source code to extract.
* @param includeComments - whether to include comments before the actual code.
* @returns the extracted source code or undefined if the source code is not found.
* @example
* ({ $, testFileMetadata }) => $.extractSourceCode(testFileMetadata.sourceLocation)
*/
extractSourceCode(location: AllureTestItemSourceLocation | undefined, includeComments?: boolean): Promise<ExtractSourceCodeHelperResult | undefined>;
/**
* Extracts the manifest of the current project or a specific package.
* Pass a callback to extract specific data from the manifest β this way you can omit async/await.
*
* @example
* ({ $ }) => $.manifest('', m => m.version)
* @example
* ({ $ }) => $.manifest('jest', jest => jest.version)
* @example
* ({ $ }) => (await $.manifest()).version
* @example
* ({ $ }) => (await $.manifest('jest')).version
*/
manifest: ManifestHelper;
/**
* Strips ANSI escape codes from the given string or object.
* @example
* $.stripAnsi('Hello, \u001b[31mworld\u001b[0m!')
* @example
* $.stripAnsi({ message: 'Hello, \u001b[31mworld\u001b[0m!' })
*/
stripAnsi: StripAnsiHelper;
}
export interface FileNavigator {
getContent(): string;
getLines(): string[];
getLineCount(): number;
getPosition(): [number, number, number];
jump(lineNumber: number): boolean;
jumpToPosition(position: number): boolean;
moveUp(countOfLines?: number): boolean;
moveDown(countOfLines?: number): boolean;
readLine(lineNumber?: number): string;
}
export interface ManifestHelper {
(packageName?: string): Promise<Record<string, any> | undefined>;
<T>(extractor: string[] | ManifestHelperExtractor<T>): Promise<T | undefined>;
<T>(extractor: string[] | ManifestHelperExtractor<T>, defaultValue: T): Promise<T>;
<T>(packageName: string, extractor: MaybeArray<string> | ManifestHelperExtractor<T>): Promise<T | undefined>;
<T>(packageName: string, extractor: MaybeArray<string> | ManifestHelperExtractor<T>, defaultValue: T): Promise<T>;
}
export type ManifestHelperExtractor<T> = (manifest: Record<string, any>) => T;
/**
* Represents the result of extracting source code from a file.
* Can be used for reporting in HTML and Markdown formats.
*/
export interface ExtractSourceCodeHelperResult {
/**
* The extracted source code.
*/
code?: string;
/**
* The programming language of the source code, usually required for syntax highlighting.
*/
language?: string;
/**
* The name of the file from which the source code was extracted.
* Code preview components may use this property to display the file name.
*/
fileName?: string;
/**
* The starting line number of the extracted source code.
* Line numbers are 1-based, meaning the first line starts at 1.
* Code preview components may use this property to highlight the code.
*/
startLine?: number;
/**
* The starting column number of the extracted source code.
* Column numbers are 1-based, meaning the first column starts at 1.
* Code preview components may use this property to put the cursor in the right place.
*/
startColumn?: number;
/**
* The ending line number of the extracted source code.
* Line numbers are 1-based, meaning the first line starts at 1.
* Code preview components may use this property to highlight the code.
*/
endLine?: number;
/**
* The ending column number of the extracted source code.
* Column numbers are 1-based, meaning the first column starts at 1.
*/
endColumn?: number;
}
export interface StripAnsiHelper {
/**
* Strips ANSI escape codes from the given string or object.
*
* @example
* $.stripAnsi('Hello, \u001b[31mworld\u001b[0m!')
*
* @example
* $.stripAnsi({ message: 'Hello, \u001b[31mworld\u001b[0m!' })
*/
<R>(textOrObject: R): R;
}
// endregion
// region Custom Metadata
export interface AllureTestItemMetadata {
/**
* File attachments to be added to the test case, test step or a test file.
*/
attachments?: Attachment[];
/**
* Property path to the current step metadata object.
* @see {steps}
* @example ['steps', '0']
*/
currentStep?: AllureTestStepPath;
/**
* Parsed docblock: comments and pragmas.
*/
docblock?: AllureTestItemDocblock;
/**
* Title of the test case or test step.
*/
displayName?: string;
/**
* Custom history ID to distinguish between tests and their retry attempts.
*/
historyId?: Primitive;
/**
* Key-value pairs to disambiguate test cases or to provide additional information.
*/
parameters?: Parameter[];
/**
* Location (file, line, column) of the test case, test step or a hook.
*/
sourceLocation?: AllureTestItemSourceLocation;
/**
* Indicates test item execution progress.
*/
stage?: Stage;
/**
* Start timestamp in milliseconds.
*/
start?: number;
/**
* Test result: failed, broken, passed, skipped or unknown.
*/
status?: Status;
/**
* Extra information about the test result: message and stack trace.
*/
statusDetails?: StatusDetails;
/**
* Recursive data structure to represent test steps for more granular reporting.
*/
steps?: AllureNestedTestStepMetadata[];
/**
* Stop timestamp in milliseconds.
*/
stop?: number;
/**
* Transformed code of the test case, test step or a hook.
*/
transformedCode?: string;
}
export type AllureTestStepPath = string[];
export type AllureNestedTestStepMetadata = Omit<AllureTestStepMetadata, 'currentStep'>;
/** @inheritDoc */
export interface AllureTestStepMetadata extends AllureTestItemMetadata {
/**
* Steps produced by Jest hooks will have this property set.
* User-defined steps don't have this property.
*/
hookType?: 'beforeAll' | 'beforeEach' | 'afterEach' | 'afterAll';
}
/** @inheritDoc */
export interface AllureTestCaseMetadata extends AllureTestItemMetadata {
/**
* Markdown description of the test case or test file.
*/
description?: string[];
/**
* Raw HTML description of the test case or test file.
*/
descriptionHtml?: string[];
fullName?: string;
labels?: Label[];
links?: Link[];
}
/** @inheritDoc */
export interface AllureTestFileMetadata extends AllureTestCaseMetadata {}
/** @inheritDoc */
export interface AllureTestRunMetadata extends AllureTestCaseMetadata {
config: unknown;
loadedFiles: string[];
sourceLocation?: never;
transformedCode?: never;
}
export interface AllureTestItemSourceLocation {
fileName?: string;
lineNumber?: number;
columnNumber?: number;
}
export interface AllureTestItemDocblock {
comments?: string;
pragmas?: Record<string, string | string[]>;
}
// endregion
// region Extensibility
export interface HelpersAugmentation {
// Use to extend Helpers
}
// endregion
// region Allure Test Data
export interface AllureTestCaseResult {
uuid?: string;
ignored?: boolean;
historyId: Primitive;
displayName: string;
fullName: string;
start: number;
stop: number;
description?: string;
descriptionHtml?: string;
stage: Stage;
status: Status;
statusDetails?: StatusDetails;
steps?: AllureTestStepResult[];
labels?: Label[];
links?: Link[];
attachments?: Attachment[];
parameters?: Parameter[];
}
export interface AllureTestStepResult {
ignored?: boolean;
hookType?: AllureTestStepMetadata['hookType'];
displayName: string;
start: number;
stop: number;
stage: Stage;
status: Status;
statusDetails?: StatusDetails;
steps?: AllureTestStepResult[];
attachments?: Attachment[];
parameters?: Parameter[];
}
// endregion
//region Allure Vendor types
export interface Attachment {
name: string;
type: string;
source: string;
}
export interface Category {
name?: string;
description?: string;
descriptionHtml?: string;
messageRegex?: string | RegExp;
traceRegex?: string | RegExp;
matchedStatuses?: Status[];
flaky?: boolean;
}
export interface ExecutorInfo {
name?: string;
type?:
| 'jenkins'
| 'bamboo'
| 'teamcity'
| 'gitlab'
| 'github'
| 'circleci'
| string;
url?: string;
buildOrder?: number;
buildName?: string;
buildUrl?: string;
reportUrl?: string;
reportName?: string;
}
export interface Label {
name: LabelName;
value: string;
}
export type LabelName =
| KnownLabelName
| string;
export type KnownLabelName =
| 'epic'
| 'feature'
| 'owner'
| 'package'
| 'parentSuite'
| 'severity'
| 'story'
| 'subSuite'
| 'suite'
| 'tag'
| 'testClass'
| 'testMethod'
| 'thread';
export interface Link {
name?: string;
url: string;
type?: LinkType;
}
export type LinkType = KnownLinkType | string;
export type KnownLinkType = 'issue' | 'tms';
export interface Parameter {
name: string;
value: Primitive;
excluded?: boolean;
mode?: ParameterMode;
}
export type ParameterMode = 'hidden' | 'masked' | 'default';
export type Severity = 'blocker' | 'critical' | 'normal' | 'minor' | 'trivial';
export type Stage = 'scheduled' | 'running' | 'finished' | 'pending' | 'interrupted';
export type Status = 'failed' | 'broken' | 'passed' | 'skipped' | 'unknown';
export interface StatusDetails {
message?: string;
trace?: string;
}
//endregion
export type Primitive = string | number | boolean | null | undefined;
export type MaybePromise<T> = T | Promise<T>;
export type MaybeArray<T> = T | T[];
export type MaybeNullish<T> = T | null | undefined;
export type MaybeFunction<T> = T | ((...args: any[]) => T);
export type MaybeWithOptions<T> = T | [T, unknown?];
}
export default class JestAllure2Reporter extends JestMetadataReporter {
constructor(globalConfig: Config.GlobalConfig, options: ReporterOptions);
}