@serenity-js/console-reporter 3.25.0 → 3.25.2
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.
- package/CHANGELOG.md +19 -0
- package/README.md +2 -2
- package/lib/stage/crew/console-reporter/ConsoleReporter.d.ts +3 -3
- package/lib/stage/crew/console-reporter/ConsoleReporter.js +3 -3
- package/lib/stage/crew/console-reporter/ConsoleReporterConfig.d.ts +1 -1
- package/lib/stage/crew/console-reporter/Printer.d.ts +9 -27
- package/lib/stage/crew/console-reporter/Printer.d.ts.map +1 -1
- package/lib/stage/crew/console-reporter/Printer.js +9 -27
- package/lib/stage/crew/console-reporter/Printer.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.d.ts +5 -24
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.d.ts.map +1 -1
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.js +5 -24
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.d.ts +4 -10
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.d.ts.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.js +4 -10
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForDarkTerminals.d.ts +6 -22
- package/lib/stage/crew/console-reporter/themes/ThemeForDarkTerminals.d.ts.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForDarkTerminals.js +6 -22
- package/lib/stage/crew/console-reporter/themes/ThemeForDarkTerminals.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForLightTerminals.d.ts +7 -23
- package/lib/stage/crew/console-reporter/themes/ThemeForLightTerminals.d.ts.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForLightTerminals.js +7 -23
- package/lib/stage/crew/console-reporter/themes/ThemeForLightTerminals.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.d.ts +8 -24
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.d.ts.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.js +8 -24
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.js.map +1 -1
- package/package.json +4 -4
- package/src/stage/crew/console-reporter/ConsoleReporter.ts +3 -3
- package/src/stage/crew/console-reporter/ConsoleReporterConfig.ts +1 -1
- package/src/stage/crew/console-reporter/Printer.ts +9 -27
- package/src/stage/crew/console-reporter/themes/TerminalTheme.ts +5 -24
- package/src/stage/crew/console-reporter/themes/ThemeForColourTerminals.ts +4 -10
- package/src/stage/crew/console-reporter/themes/ThemeForDarkTerminals.ts +6 -22
- package/src/stage/crew/console-reporter/themes/ThemeForLightTerminals.ts +7 -23
- package/src/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.ts +8 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.25.2](https://github.com/serenity-js/serenity-js/compare/v3.25.1...v3.25.2) (2024-07-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @serenity-js/console-reporter
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.25.1](https://github.com/serenity-js/serenity-js/compare/v3.25.0...v3.25.1) (2024-07-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **core:** all the API docs now link to the online Serenity/JS API documentation ([f8f451d](https://github.com/serenity-js/serenity-js/commit/f8f451dffdb4caaa2e31a860f59d59470f4856ad))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [3.25.0](https://github.com/serenity-js/serenity-js/compare/v3.24.1...v3.25.0) (2024-07-03)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @serenity-js/console-reporter
|
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ of complex software systems faster, more collaborative and easier to scale.
|
|
|
17
17
|
👋 Join the Serenity/JS Community!
|
|
18
18
|
- Meet other Serenity/JS developers and maintainers on the [Serenity/JS Community chat channel](https://matrix.to/#/#serenity-js:gitter.im),
|
|
19
19
|
- Find answers to your Serenity/JS questions on the [Serenity/JS Forum](https://github.com/orgs/serenity-js/discussions/categories/how-do-i),
|
|
20
|
-
- Learn how to [contribute to Serenity/JS](https://serenity-js.org/contributing),
|
|
20
|
+
- Learn how to [contribute to Serenity/JS](https://serenity-js.org/community/contributing/),
|
|
21
21
|
- Support the project and gain access to [Serenity/JS Playbooks](https://github.com/serenity-js/playbooks) by becoming a [Serenity/JS GitHub Sponsor](https://github.com/sponsors/serenity-js)!
|
|
22
22
|
|
|
23
23
|
## Serenity/JS Console Reporter
|
|
@@ -148,7 +148,7 @@ configure({
|
|
|
148
148
|
|
|
149
149
|
#### Colour Themes
|
|
150
150
|
|
|
151
|
-
Consult the API docs of the [`ConsoleReporter`](/api/console-reporter/class/ConsoleReporter) class
|
|
151
|
+
Consult the API docs of the [`ConsoleReporter`](https://serenity-js.org/api/console-reporter/class/ConsoleReporter) class
|
|
152
152
|
to learn more about the supported colour themes.
|
|
153
153
|
|
|
154
154
|
## 📣 Stay up to date
|
|
@@ -4,7 +4,7 @@ import type { ConsoleReporterConfig } from './ConsoleReporterConfig';
|
|
|
4
4
|
import { Printer } from './Printer';
|
|
5
5
|
import type { TerminalTheme } from './themes';
|
|
6
6
|
/**
|
|
7
|
-
* A
|
|
7
|
+
* A [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) that uses [standard output](https://en.wikipedia.org/wiki/Standard_streams)
|
|
8
8
|
* to report on progress of your Serenity/JS acceptance tests.
|
|
9
9
|
*
|
|
10
10
|
* `ConsoleReporter` ships with colour themes for both dark and light terminals,
|
|
@@ -167,9 +167,9 @@ export declare class ConsoleReporter implements ListensToDomainEvents {
|
|
|
167
167
|
*/
|
|
168
168
|
constructor(printer: Printer, theme: TerminalTheme, stage?: Stage);
|
|
169
169
|
/**
|
|
170
|
-
* Handles
|
|
170
|
+
* Handles [`DomainEvent`](https://serenity-js.org/api/core-events/class/DomainEvent/) objects emitted by the [`Stage`](https://serenity-js.org/api/core/class/Stage/).
|
|
171
171
|
*
|
|
172
|
-
* @see
|
|
172
|
+
* @see [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
173
173
|
*
|
|
174
174
|
* @listens {DomainEvent}
|
|
175
175
|
*
|
|
@@ -11,7 +11,7 @@ const Summary_1 = require("./Summary");
|
|
|
11
11
|
const SummaryFormatter_1 = require("./SummaryFormatter");
|
|
12
12
|
const themes_1 = require("./themes");
|
|
13
13
|
/**
|
|
14
|
-
* A
|
|
14
|
+
* A [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) that uses [standard output](https://en.wikipedia.org/wiki/Standard_streams)
|
|
15
15
|
* to report on progress of your Serenity/JS acceptance tests.
|
|
16
16
|
*
|
|
17
17
|
* `ConsoleReporter` ships with colour themes for both dark and light terminals,
|
|
@@ -202,9 +202,9 @@ class ConsoleReporter {
|
|
|
202
202
|
this.summaryFormatter = new SummaryFormatter_1.SummaryFormatter(this.theme);
|
|
203
203
|
}
|
|
204
204
|
/**
|
|
205
|
-
* Handles
|
|
205
|
+
* Handles [`DomainEvent`](https://serenity-js.org/api/core-events/class/DomainEvent/) objects emitted by the [`Stage`](https://serenity-js.org/api/core/class/Stage/).
|
|
206
206
|
*
|
|
207
|
-
* @see
|
|
207
|
+
* @see [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
208
208
|
*
|
|
209
209
|
* @listens {DomainEvent}
|
|
210
210
|
*
|
|
@@ -1,49 +1,31 @@
|
|
|
1
1
|
import type { OutputStream } from '@serenity-js/core/lib/adapter';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* with support for indenting the printed text.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
3
|
+
* A simple abstraction around the standard output stream
|
|
4
|
+
* with support for indenting the printed text.
|
|
8
5
|
*/
|
|
9
6
|
export declare class Printer {
|
|
10
7
|
private readonly stdout;
|
|
11
8
|
private indentation;
|
|
12
9
|
constructor(stdout?: OutputStream);
|
|
13
10
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Prints the `args` to the `stdout`, followed by a new line character (`\n`).
|
|
11
|
+
* Prints the `args` to the `stdout`, followed by a new line character (`\n`).
|
|
16
12
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* Please note that this method bypasses any indentation as it's intended
|
|
14
|
+
* to be used to print separator lines, etc.
|
|
19
15
|
*
|
|
20
|
-
* @param {...any[]} args
|
|
21
|
-
*
|
|
22
|
-
* @returns {void}
|
|
23
16
|
*/
|
|
24
17
|
println(...args: any[]): void;
|
|
25
18
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the current indentation level.
|
|
29
|
-
*
|
|
30
|
-
* @param {...any[]} args
|
|
31
|
-
*
|
|
32
|
-
* @returns {void}
|
|
19
|
+
* Prints the `args` to the `stdout`, indenting the output according to
|
|
20
|
+
* the current indentation level.
|
|
33
21
|
*/
|
|
34
22
|
print(...args: any[]): void;
|
|
35
23
|
/**
|
|
36
|
-
*
|
|
37
|
-
* Increases the current indentation by 2 spaces.
|
|
38
|
-
*
|
|
39
|
-
* @returns {void}
|
|
24
|
+
* Increases the current indentation by 2 spaces.
|
|
40
25
|
*/
|
|
41
26
|
indent(): void;
|
|
42
27
|
/**
|
|
43
|
-
*
|
|
44
|
-
* Reduces the current indentation by 2 spaces.
|
|
45
|
-
*
|
|
46
|
-
* @returns {void}
|
|
28
|
+
* Reduces the current indentation by 2 spaces.
|
|
47
29
|
*/
|
|
48
30
|
outdent(): void;
|
|
49
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Printer.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/console-reporter/Printer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"Printer.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/console-reporter/Printer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE;;;GAGG;AACH,qBAAa,OAAO;IAGJ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,WAAW,CAAsB;gBAEZ,MAAM,GAAE,YAA6B;IAGlE;;;;;;OAMG;IACH,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI7B;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM3B;;OAEG;IACH,MAAM,IAAI,IAAI;IAId;;OAEG;IACH,OAAO,IAAI,IAAI;CAGlB"}
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Printer = void 0;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* with support for indenting the printed text.
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
5
|
+
* A simple abstraction around the standard output stream
|
|
6
|
+
* with support for indenting the printed text.
|
|
10
7
|
*/
|
|
11
8
|
class Printer {
|
|
12
9
|
stdout;
|
|
@@ -15,45 +12,30 @@ class Printer {
|
|
|
15
12
|
this.stdout = stdout;
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Prints the `args` to the `stdout`, followed by a new line character (`\n`).
|
|
15
|
+
* Prints the `args` to the `stdout`, followed by a new line character (`\n`).
|
|
20
16
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* Please note that this method bypasses any indentation as it's intended
|
|
18
|
+
* to be used to print separator lines, etc.
|
|
23
19
|
*
|
|
24
|
-
* @param {...any[]} args
|
|
25
|
-
*
|
|
26
|
-
* @returns {void}
|
|
27
20
|
*/
|
|
28
21
|
println(...args) {
|
|
29
22
|
return this.print(...args, '\n');
|
|
30
23
|
}
|
|
31
24
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* the current indentation level.
|
|
35
|
-
*
|
|
36
|
-
* @param {...any[]} args
|
|
37
|
-
*
|
|
38
|
-
* @returns {void}
|
|
25
|
+
* Prints the `args` to the `stdout`, indenting the output according to
|
|
26
|
+
* the current indentation level.
|
|
39
27
|
*/
|
|
40
28
|
print(...args) {
|
|
41
29
|
this.stdout.write(this.indentation.indented(`${args.map(String).join('')}`));
|
|
42
30
|
}
|
|
43
31
|
/**
|
|
44
|
-
*
|
|
45
|
-
* Increases the current indentation by 2 spaces.
|
|
46
|
-
*
|
|
47
|
-
* @returns {void}
|
|
32
|
+
* Increases the current indentation by 2 spaces.
|
|
48
33
|
*/
|
|
49
34
|
indent() {
|
|
50
35
|
this.indentation.increase();
|
|
51
36
|
}
|
|
52
37
|
/**
|
|
53
|
-
*
|
|
54
|
-
* Reduces the current indentation by 2 spaces.
|
|
55
|
-
*
|
|
56
|
-
* @returns {void}
|
|
38
|
+
* Reduces the current indentation by 2 spaces.
|
|
57
39
|
*/
|
|
58
40
|
outdent() {
|
|
59
41
|
this.indentation.decrease();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Printer.js","sourceRoot":"","sources":["../../../../src/stage/crew/console-reporter/Printer.ts"],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"Printer.js","sourceRoot":"","sources":["../../../../src/stage/crew/console-reporter/Printer.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,OAAO;IAGa;IAFrB,WAAW,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;IAEzC,YAA6B,SAAuB,OAAO,CAAC,MAAM;QAArC,WAAM,GAAN,MAAM,CAA+B;IAClE,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,GAAG,IAAW;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAW;QAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAE,EAAE,CAAC,CAC9D,CAAC;IACN,CAAC;IAED;;OAEG;IACH,MAAM;QACF,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,OAAO;QACH,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;CACJ;AAxCD,0BAwCC;AAED;;GAEG;AACH,MAAM,WAAW;IAGgB;IAFrB,OAAO,GAAG,CAAC,CAAC;IAEpB,YAA6B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IACzC,CAAC;IAED,QAAQ;QACJ,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED,QAAQ;QACJ,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE;YAC/B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC;SAC7B;IACL,CAAC;IAED,QAAQ,CAAC,GAAG,SAAmB;QAC3B,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;aACpB,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI;YACb,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI;YACjC,CAAC,CAAC,EAAE,CACP;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;CACJ"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { Outcome } from '@serenity-js/core/lib/model';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* print output in colour.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
* @abstract
|
|
3
|
+
* Decorates text with control characters to make the terminal
|
|
4
|
+
* print output in colour.
|
|
9
5
|
*/
|
|
10
6
|
export declare abstract class TerminalTheme {
|
|
11
7
|
abstract heading(...parts: any[]): string;
|
|
@@ -13,27 +9,12 @@ export declare abstract class TerminalTheme {
|
|
|
13
9
|
abstract separator(pattern: string): string;
|
|
14
10
|
abstract log(...parts: any[]): string;
|
|
15
11
|
/**
|
|
16
|
-
*
|
|
17
|
-
* Converts the `parts` to `string` and joins them together.
|
|
18
|
-
*
|
|
19
|
-
* @protected
|
|
20
|
-
*
|
|
21
|
-
* @param {any[]} parts
|
|
22
|
-
*
|
|
23
|
-
* @returns {string}
|
|
12
|
+
* Converts the `parts` to `string` and joins them together.
|
|
24
13
|
*/
|
|
25
14
|
protected joined(parts: any[]): string;
|
|
26
15
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Used to produce separator lines.
|
|
30
|
-
*
|
|
31
|
-
* @protected
|
|
32
|
-
*
|
|
33
|
-
* @param {string} pattern
|
|
34
|
-
* @param {number} [maxLength=80] maxLength
|
|
35
|
-
*
|
|
36
|
-
* @returns {string}
|
|
16
|
+
* Repeats a given `pattern` so that it takes up to `maxLength` characters.
|
|
17
|
+
* Used to produce separator lines.
|
|
37
18
|
*/
|
|
38
19
|
protected repeat(pattern: string, maxLength?: number): string;
|
|
39
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalTheme.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/TerminalTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"TerminalTheme.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/TerminalTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;;GAGG;AACH,8BAAsB,aAAa;IAC/B,QAAQ,CAAC,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IACzC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IACpE,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAC3C,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IAErC;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IAItC;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,SAAK,GAAG,MAAM;CAS5D"}
|
|
@@ -2,38 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TerminalTheme = void 0;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* print output in colour.
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
10
|
-
* @abstract
|
|
5
|
+
* Decorates text with control characters to make the terminal
|
|
6
|
+
* print output in colour.
|
|
11
7
|
*/
|
|
12
8
|
class TerminalTheme {
|
|
13
9
|
/**
|
|
14
|
-
*
|
|
15
|
-
* Converts the `parts` to `string` and joins them together.
|
|
16
|
-
*
|
|
17
|
-
* @protected
|
|
18
|
-
*
|
|
19
|
-
* @param {any[]} parts
|
|
20
|
-
*
|
|
21
|
-
* @returns {string}
|
|
10
|
+
* Converts the `parts` to `string` and joins them together.
|
|
22
11
|
*/
|
|
23
12
|
joined(parts) {
|
|
24
13
|
return parts.map(String).join('');
|
|
25
14
|
}
|
|
26
15
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Used to produce separator lines.
|
|
30
|
-
*
|
|
31
|
-
* @protected
|
|
32
|
-
*
|
|
33
|
-
* @param {string} pattern
|
|
34
|
-
* @param {number} [maxLength=80] maxLength
|
|
35
|
-
*
|
|
36
|
-
* @returns {string}
|
|
16
|
+
* Repeats a given `pattern` so that it takes up to `maxLength` characters.
|
|
17
|
+
* Used to produce separator lines.
|
|
37
18
|
*/
|
|
38
19
|
repeat(pattern, maxLength = 80) {
|
|
39
20
|
if (!pattern) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalTheme.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/TerminalTheme.ts"],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"TerminalTheme.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/TerminalTheme.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAsB,aAAa;IAM/B;;OAEG;IACO,MAAM,CAAC,KAAY;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACO,MAAM,CAAC,OAAe,EAAE,SAAS,GAAG,EAAE;QAC5C,IAAI,CAAE,OAAO,EAAE;YACX,OAAO,EAAE,CAAC;SACb;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAE3D,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;CACJ;AA1BD,sCA0BC"}
|
|
@@ -2,14 +2,8 @@ import { Outcome } from '@serenity-js/core/lib/model';
|
|
|
2
2
|
import type { Chalk } from 'chalk';
|
|
3
3
|
import { TerminalTheme } from './TerminalTheme';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* to print to terminals that support colour output.
|
|
8
|
-
*
|
|
9
|
-
* @extends {TerminalTheme}
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
* @abstract
|
|
5
|
+
* Base class for `TerminalTheme` implementations intended
|
|
6
|
+
* to print to terminals that support colour output.
|
|
13
7
|
*/
|
|
14
8
|
export declare abstract class ThemeForColourTerminals extends TerminalTheme {
|
|
15
9
|
protected readonly chalk: Chalk;
|
|
@@ -21,10 +15,10 @@ export declare abstract class ThemeForColourTerminals extends TerminalTheme {
|
|
|
21
15
|
constructor(chalk: Chalk);
|
|
22
16
|
/**
|
|
23
17
|
* Joins the `parts` into a single string and decorates it
|
|
24
|
-
* using a colour appropriate for a given
|
|
18
|
+
* using a colour appropriate for a given `Outcome`.
|
|
25
19
|
*
|
|
26
20
|
* @param outcome
|
|
27
|
-
* an instance of an
|
|
21
|
+
* an instance of an `Outcome`
|
|
28
22
|
* or a string class name of one of its implementations.
|
|
29
23
|
*
|
|
30
24
|
* @param parts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForColourTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForColourTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgJ,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACpM,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"ThemeForColourTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForColourTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgJ,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACpM,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,8BAAsB,uBAAwB,SAAQ,aAAa;IAOnD,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK;IAL3C;;;;OAIG;gBAC4B,KAAK,EAAE,KAAK;IAI3C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;CAqB9D"}
|
|
@@ -4,14 +4,8 @@ exports.ThemeForColourTerminals = void 0;
|
|
|
4
4
|
const model_1 = require("@serenity-js/core/lib/model");
|
|
5
5
|
const TerminalTheme_1 = require("./TerminalTheme");
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* to print to terminals that support colour output.
|
|
10
|
-
*
|
|
11
|
-
* @extends {TerminalTheme}
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
* @abstract
|
|
7
|
+
* Base class for `TerminalTheme` implementations intended
|
|
8
|
+
* to print to terminals that support colour output.
|
|
15
9
|
*/
|
|
16
10
|
class ThemeForColourTerminals extends TerminalTheme_1.TerminalTheme {
|
|
17
11
|
chalk;
|
|
@@ -26,10 +20,10 @@ class ThemeForColourTerminals extends TerminalTheme_1.TerminalTheme {
|
|
|
26
20
|
}
|
|
27
21
|
/**
|
|
28
22
|
* Joins the `parts` into a single string and decorates it
|
|
29
|
-
* using a colour appropriate for a given
|
|
23
|
+
* using a colour appropriate for a given `Outcome`.
|
|
30
24
|
*
|
|
31
25
|
* @param outcome
|
|
32
|
-
* an instance of an
|
|
26
|
+
* an instance of an `Outcome`
|
|
33
27
|
* or a string class name of one of its implementations.
|
|
34
28
|
*
|
|
35
29
|
* @param parts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForColourTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForColourTerminals.ts"],"names":[],"mappings":";;;AAAA,uDAAoM;AAGpM,mDAAgD;AAEhD
|
|
1
|
+
{"version":3,"file":"ThemeForColourTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForColourTerminals.ts"],"names":[],"mappings":";;;AAAA,uDAAoM;AAGpM,mDAAgD;AAEhD;;;GAGG;AACH,MAAsB,uBAAwB,SAAQ,6BAAa;IAOhC;IAL/B;;;;OAIG;IACH,YAA+B,KAAY;QACvC,KAAK,EAAE,CAAC;QADmB,UAAK,GAAL,KAAK,CAAO;IAE3C,CAAC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAyB,EAAE,GAAG,KAAY;QAC9C,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,eAAO,CAAC;YAC5C,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI;YAC1B,CAAC,CAAC,OAAO,CAAC;QAEd,QAAQ,WAAW,EAAE;YACjB,KAAK,4BAAoB,CAAC,IAAI;gBAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAClD,KAAK,gCAAwB,CAAC,IAAI,CAAC;YACnC,KAAK,yCAAiC,CAAC,IAAI;gBACvC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9C,KAAK,6BAAqB,CAAC,IAAI;gBAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC/C,KAAK,wBAAgB,CAAC,IAAI,CAAC;YAC3B,KAAK,wBAAgB,CAAC,IAAI;gBACtB,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACtD,iCAAiC;YACjC;gBACI,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SACnD;IACL,CAAC;CACJ;AA3CD,0DA2CC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { Chalk } from 'chalk';
|
|
2
2
|
import { ThemeForColourTerminals } from './ThemeForColourTerminals';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* A simple colour theme for terminals with dark backgrounds.
|
|
6
|
-
*
|
|
7
|
-
* @extends {ThemeForColourTerminals}
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
4
|
+
* A simple colour theme for terminals with dark backgrounds.
|
|
10
5
|
*/
|
|
11
6
|
export declare class ThemeForDarkTerminals extends ThemeForColourTerminals {
|
|
12
7
|
/**
|
|
@@ -16,32 +11,21 @@ export declare class ThemeForDarkTerminals extends ThemeForColourTerminals {
|
|
|
16
11
|
*/
|
|
17
12
|
constructor(chalk: Chalk);
|
|
18
13
|
/**
|
|
19
|
-
*
|
|
20
|
-
* Formats the heading
|
|
14
|
+
* Formats the heading
|
|
21
15
|
*
|
|
22
|
-
* @param
|
|
16
|
+
* @param parts
|
|
23
17
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
24
|
-
*
|
|
25
|
-
* @returns {string}
|
|
26
18
|
*/
|
|
27
19
|
heading(...parts: any[]): string;
|
|
28
20
|
/**
|
|
29
|
-
*
|
|
30
|
-
* Decorates the heading with theme colours.
|
|
21
|
+
* Decorates the heading with theme colours.
|
|
31
22
|
*
|
|
32
|
-
* @param
|
|
23
|
+
* @param pattern
|
|
33
24
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
34
|
-
*
|
|
35
|
-
* @returns {string}
|
|
36
25
|
*/
|
|
37
26
|
separator(pattern: string): string;
|
|
38
27
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
41
|
-
*
|
|
42
|
-
* @param {...any[]} parts
|
|
43
|
-
*
|
|
44
|
-
* @returns {string}
|
|
28
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
45
29
|
*/
|
|
46
30
|
log(...parts: any[]): string;
|
|
47
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForDarkTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForDarkTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"ThemeForDarkTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForDarkTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,uBAAuB;IAE9D;;;;OAIG;gBACS,KAAK,EAAE,KAAK;IAIxB;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IAIhC;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIlC;;OAEG;IACH,GAAG,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;CAG/B"}
|
|
@@ -3,12 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ThemeForDarkTerminals = void 0;
|
|
4
4
|
const ThemeForColourTerminals_1 = require("./ThemeForColourTerminals");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* A simple colour theme for terminals with dark backgrounds.
|
|
8
|
-
*
|
|
9
|
-
* @extends {ThemeForColourTerminals}
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
6
|
+
* A simple colour theme for terminals with dark backgrounds.
|
|
12
7
|
*/
|
|
13
8
|
class ThemeForDarkTerminals extends ThemeForColourTerminals_1.ThemeForColourTerminals {
|
|
14
9
|
/**
|
|
@@ -20,36 +15,25 @@ class ThemeForDarkTerminals extends ThemeForColourTerminals_1.ThemeForColourTerm
|
|
|
20
15
|
super(chalk);
|
|
21
16
|
}
|
|
22
17
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Formats the heading
|
|
18
|
+
* Formats the heading
|
|
25
19
|
*
|
|
26
|
-
* @param
|
|
20
|
+
* @param parts
|
|
27
21
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
28
|
-
*
|
|
29
|
-
* @returns {string}
|
|
30
22
|
*/
|
|
31
23
|
heading(...parts) {
|
|
32
24
|
return this.chalk.bold.white(this.joined(parts));
|
|
33
25
|
}
|
|
34
26
|
/**
|
|
35
|
-
*
|
|
36
|
-
* Decorates the heading with theme colours.
|
|
27
|
+
* Decorates the heading with theme colours.
|
|
37
28
|
*
|
|
38
|
-
* @param
|
|
29
|
+
* @param pattern
|
|
39
30
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
40
|
-
*
|
|
41
|
-
* @returns {string}
|
|
42
31
|
*/
|
|
43
32
|
separator(pattern) {
|
|
44
33
|
return this.chalk.yellow(this.repeat(pattern));
|
|
45
34
|
}
|
|
46
35
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
49
|
-
*
|
|
50
|
-
* @param {...any[]} parts
|
|
51
|
-
*
|
|
52
|
-
* @returns {string}
|
|
36
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
53
37
|
*/
|
|
54
38
|
log(...parts) {
|
|
55
39
|
return this.chalk.yellow(this.joined(parts));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForDarkTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForDarkTerminals.ts"],"names":[],"mappings":";;;AAEA,uEAAoE;AAEpE
|
|
1
|
+
{"version":3,"file":"ThemeForDarkTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForDarkTerminals.ts"],"names":[],"mappings":";;;AAEA,uEAAoE;AAEpE;;GAEG;AACH,MAAa,qBAAsB,SAAQ,iDAAuB;IAE9D;;;;OAIG;IACH,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,OAAe;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,GAAG,KAAY;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;CACJ;AArCD,sDAqCC"}
|
|
@@ -1,47 +1,31 @@
|
|
|
1
1
|
import type { Chalk } from 'chalk';
|
|
2
2
|
import { ThemeForColourTerminals } from './ThemeForColourTerminals';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* A simple colour theme for terminals with light backgrounds.
|
|
6
|
-
*
|
|
7
|
-
* @extends {ThemeForColourTerminals}
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
4
|
+
* A simple colour theme for terminals with light backgrounds.
|
|
10
5
|
*/
|
|
11
6
|
export declare class ThemeForLightTerminals extends ThemeForColourTerminals {
|
|
12
7
|
/**
|
|
13
|
-
* @param {chalk~Chalk} chalk
|
|
14
|
-
*
|
|
15
8
|
* @see https://www.npmjs.com/package/chalk
|
|
16
9
|
*/
|
|
17
10
|
constructor(chalk: Chalk);
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
20
|
-
* Decorates the heading with theme colours.
|
|
12
|
+
* Decorates the heading with theme colours.
|
|
21
13
|
*
|
|
22
|
-
* @param
|
|
14
|
+
* @param parts
|
|
23
15
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
24
|
-
*
|
|
25
|
-
* @returns {string}
|
|
26
16
|
*/
|
|
27
17
|
heading(...parts: any[]): string;
|
|
28
18
|
/**
|
|
29
|
-
*
|
|
30
|
-
* Decorates the heading with theme colours.
|
|
19
|
+
* Decorates the heading with theme colours.
|
|
31
20
|
*
|
|
32
|
-
* @param
|
|
21
|
+
* @param pattern
|
|
33
22
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
34
|
-
*
|
|
35
|
-
* @returns {string}
|
|
36
23
|
*/
|
|
37
24
|
separator(pattern: string): string;
|
|
38
25
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
41
|
-
*
|
|
42
|
-
* @param {...any[]} parts
|
|
26
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
43
27
|
*
|
|
44
|
-
* @
|
|
28
|
+
* @param parts
|
|
45
29
|
*/
|
|
46
30
|
log(...parts: any[]): string;
|
|
47
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForLightTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForLightTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"ThemeForLightTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForLightTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,uBAAuB;IAE/D;;OAEG;gBACS,KAAK,EAAE,KAAK;IAIxB;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IAIhC;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIlC;;;;OAIG;IACH,GAAG,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;CAG/B"}
|
|
@@ -3,53 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ThemeForLightTerminals = void 0;
|
|
4
4
|
const ThemeForColourTerminals_1 = require("./ThemeForColourTerminals");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* A simple colour theme for terminals with light backgrounds.
|
|
8
|
-
*
|
|
9
|
-
* @extends {ThemeForColourTerminals}
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
6
|
+
* A simple colour theme for terminals with light backgrounds.
|
|
12
7
|
*/
|
|
13
8
|
class ThemeForLightTerminals extends ThemeForColourTerminals_1.ThemeForColourTerminals {
|
|
14
9
|
/**
|
|
15
|
-
* @param {chalk~Chalk} chalk
|
|
16
|
-
*
|
|
17
10
|
* @see https://www.npmjs.com/package/chalk
|
|
18
11
|
*/
|
|
19
12
|
constructor(chalk) {
|
|
20
13
|
super(chalk);
|
|
21
14
|
}
|
|
22
15
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Decorates the heading with theme colours.
|
|
16
|
+
* Decorates the heading with theme colours.
|
|
25
17
|
*
|
|
26
|
-
* @param
|
|
18
|
+
* @param parts
|
|
27
19
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
28
|
-
*
|
|
29
|
-
* @returns {string}
|
|
30
20
|
*/
|
|
31
21
|
heading(...parts) {
|
|
32
22
|
return this.chalk.bold.black(this.joined(parts));
|
|
33
23
|
}
|
|
34
24
|
/**
|
|
35
|
-
*
|
|
36
|
-
* Decorates the heading with theme colours.
|
|
25
|
+
* Decorates the heading with theme colours.
|
|
37
26
|
*
|
|
38
|
-
* @param
|
|
27
|
+
* @param pattern
|
|
39
28
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
40
|
-
*
|
|
41
|
-
* @returns {string}
|
|
42
29
|
*/
|
|
43
30
|
separator(pattern) {
|
|
44
31
|
return this.repeat(pattern);
|
|
45
32
|
}
|
|
46
33
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
49
|
-
*
|
|
50
|
-
* @param {...any[]} parts
|
|
34
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
51
35
|
*
|
|
52
|
-
* @
|
|
36
|
+
* @param parts
|
|
53
37
|
*/
|
|
54
38
|
log(...parts) {
|
|
55
39
|
return this.joined(parts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForLightTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForLightTerminals.ts"],"names":[],"mappings":";;;AAEA,uEAAoE;AAEpE
|
|
1
|
+
{"version":3,"file":"ThemeForLightTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForLightTerminals.ts"],"names":[],"mappings":";;;AAEA,uEAAoE;AAEpE;;GAEG;AACH,MAAa,sBAAuB,SAAQ,iDAAuB;IAE/D;;OAEG;IACH,YAAY,KAAY;QACpB,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,OAAe;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,GAAG,KAAY;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACJ;AArCD,wDAqCC"}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
import type { Outcome } from '@serenity-js/core/lib/model';
|
|
2
2
|
import { TerminalTheme } from './TerminalTheme';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* A simple colour theme for terminals with no colour support.
|
|
6
|
-
*
|
|
7
|
-
* @extends {TerminalTheme}
|
|
8
|
-
*
|
|
9
|
-
* @public
|
|
4
|
+
* A simple colour theme for terminals with no colour support.
|
|
10
5
|
*/
|
|
11
6
|
export declare class ThemeForMonochromaticTerminals extends TerminalTheme {
|
|
12
7
|
/**
|
|
13
|
-
*
|
|
14
|
-
* Formats the heading
|
|
8
|
+
* Formats the heading
|
|
15
9
|
*
|
|
16
|
-
* @param
|
|
10
|
+
* @param parts
|
|
17
11
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
18
|
-
*
|
|
19
|
-
* @returns {string}
|
|
20
12
|
*/
|
|
21
13
|
heading(...parts: any[]): string;
|
|
22
14
|
/**
|
|
@@ -25,32 +17,24 @@ export declare class ThemeForMonochromaticTerminals extends TerminalTheme {
|
|
|
25
17
|
* no decoration of the text is performed.
|
|
26
18
|
*
|
|
27
19
|
* @param outcome
|
|
28
|
-
* an instance of an
|
|
20
|
+
* an instance of an `Outcome`
|
|
29
21
|
* or a string class name of one of its implementations.
|
|
30
22
|
*
|
|
31
23
|
* @param parts
|
|
32
24
|
* the parts of the message
|
|
33
|
-
*
|
|
34
|
-
* @returns {string}
|
|
35
25
|
*/
|
|
36
26
|
outcome(outcome: Outcome, ...parts: any[]): string;
|
|
37
27
|
/**
|
|
38
|
-
*
|
|
39
|
-
* Decorates the heading with theme colours.
|
|
28
|
+
* Decorates the heading with theme colours.
|
|
40
29
|
*
|
|
41
|
-
* @param
|
|
30
|
+
* @param pattern
|
|
42
31
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
43
|
-
*
|
|
44
|
-
* @returns {string}
|
|
45
32
|
*/
|
|
46
33
|
separator(pattern: string): string;
|
|
47
34
|
/**
|
|
48
|
-
*
|
|
49
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
50
|
-
*
|
|
51
|
-
* @param {...any[]} parts
|
|
35
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
52
36
|
*
|
|
53
|
-
* @
|
|
37
|
+
* @param parts
|
|
54
38
|
*/
|
|
55
39
|
log(...parts: any[]): string;
|
|
56
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForMonochromaticTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"ThemeForMonochromaticTerminals.d.ts","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,aAAa;IAE7D;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IAIhC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;IAIlD;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIlC;;;;OAIG;IACH,GAAG,CAAC,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;CAG/B"}
|
|
@@ -3,22 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ThemeForMonochromaticTerminals = void 0;
|
|
4
4
|
const TerminalTheme_1 = require("./TerminalTheme");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* A simple colour theme for terminals with no colour support.
|
|
8
|
-
*
|
|
9
|
-
* @extends {TerminalTheme}
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
6
|
+
* A simple colour theme for terminals with no colour support.
|
|
12
7
|
*/
|
|
13
8
|
class ThemeForMonochromaticTerminals extends TerminalTheme_1.TerminalTheme {
|
|
14
9
|
/**
|
|
15
|
-
*
|
|
16
|
-
* Formats the heading
|
|
10
|
+
* Formats the heading
|
|
17
11
|
*
|
|
18
|
-
* @param
|
|
12
|
+
* @param parts
|
|
19
13
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
20
|
-
*
|
|
21
|
-
* @returns {string}
|
|
22
14
|
*/
|
|
23
15
|
heading(...parts) {
|
|
24
16
|
return this.joined(parts);
|
|
@@ -29,36 +21,28 @@ class ThemeForMonochromaticTerminals extends TerminalTheme_1.TerminalTheme {
|
|
|
29
21
|
* no decoration of the text is performed.
|
|
30
22
|
*
|
|
31
23
|
* @param outcome
|
|
32
|
-
* an instance of an
|
|
24
|
+
* an instance of an `Outcome`
|
|
33
25
|
* or a string class name of one of its implementations.
|
|
34
26
|
*
|
|
35
27
|
* @param parts
|
|
36
28
|
* the parts of the message
|
|
37
|
-
*
|
|
38
|
-
* @returns {string}
|
|
39
29
|
*/
|
|
40
30
|
outcome(outcome, ...parts) {
|
|
41
31
|
return this.joined(parts);
|
|
42
32
|
}
|
|
43
33
|
/**
|
|
44
|
-
*
|
|
45
|
-
* Decorates the heading with theme colours.
|
|
34
|
+
* Decorates the heading with theme colours.
|
|
46
35
|
*
|
|
47
|
-
* @param
|
|
36
|
+
* @param pattern
|
|
48
37
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
49
|
-
*
|
|
50
|
-
* @returns {string}
|
|
51
38
|
*/
|
|
52
39
|
separator(pattern) {
|
|
53
40
|
return this.repeat(pattern);
|
|
54
41
|
}
|
|
55
42
|
/**
|
|
56
|
-
*
|
|
57
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
58
|
-
*
|
|
59
|
-
* @param {...any[]} parts
|
|
43
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
60
44
|
*
|
|
61
|
-
* @
|
|
45
|
+
* @param parts
|
|
62
46
|
*/
|
|
63
47
|
log(...parts) {
|
|
64
48
|
return this.joined(parts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeForMonochromaticTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.ts"],"names":[],"mappings":";;;AAEA,mDAAgD;AAEhD
|
|
1
|
+
{"version":3,"file":"ThemeForMonochromaticTerminals.js","sourceRoot":"","sources":["../../../../../src/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.ts"],"names":[],"mappings":";;;AAEA,mDAAgD;AAEhD;;GAEG;AACH,MAAa,8BAA+B,SAAQ,6BAAa;IAE7D;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAY;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,OAAgB,EAAE,GAAG,KAAY;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,OAAe;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,GAAG,KAAY;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACJ;AA9CD,wEA8CC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-js/console-reporter",
|
|
3
|
-
"version": "3.25.
|
|
4
|
-
"description": "Serenity/JS console reporter",
|
|
3
|
+
"version": "3.25.2",
|
|
4
|
+
"description": "Serenity/JS console reporter that displays test results directly in the standard output",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Molak",
|
|
7
7
|
"email": "jan.molak@smartcodeltd.co.uk",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"node": "^16.13 || ^18.12 || ^20"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@serenity-js/core": "3.25.
|
|
46
|
+
"@serenity-js/core": "3.25.2",
|
|
47
47
|
"chalk": "4.1.2",
|
|
48
48
|
"tiny-types": "1.22.0"
|
|
49
49
|
},
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"ts-node": "10.9.2",
|
|
58
58
|
"typescript": "5.2.2"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "98b68da1e04a8fcbb255dca509b7bc9c322a3b6b"
|
|
61
61
|
}
|
|
@@ -40,7 +40,7 @@ import type { TerminalTheme} from './themes';
|
|
|
40
40
|
import { ThemeForDarkTerminals, ThemeForLightTerminals, ThemeForMonochromaticTerminals } from './themes';
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* A
|
|
43
|
+
* A [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/) that uses [standard output](https://en.wikipedia.org/wiki/Standard_streams)
|
|
44
44
|
* to report on progress of your Serenity/JS acceptance tests.
|
|
45
45
|
*
|
|
46
46
|
* `ConsoleReporter` ships with colour themes for both dark and light terminals,
|
|
@@ -239,9 +239,9 @@ export class ConsoleReporter implements ListensToDomainEvents {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
* Handles
|
|
242
|
+
* Handles [`DomainEvent`](https://serenity-js.org/api/core-events/class/DomainEvent/) objects emitted by the [`Stage`](https://serenity-js.org/api/core/class/Stage/).
|
|
243
243
|
*
|
|
244
|
-
* @see
|
|
244
|
+
* @see [`StageCrewMember`](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
245
245
|
*
|
|
246
246
|
* @listens {DomainEvent}
|
|
247
247
|
*
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { OutputStream } from '@serenity-js/core/lib/adapter';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* with support for indenting the printed text.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
4
|
+
* A simple abstraction around the standard output stream
|
|
5
|
+
* with support for indenting the printed text.
|
|
9
6
|
*/
|
|
10
7
|
export class Printer {
|
|
11
8
|
private indentation = new Indentation(2);
|
|
@@ -14,28 +11,19 @@ export class Printer {
|
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Prints the `args` to the `stdout`, followed by a new line character (`\n`).
|
|
14
|
+
* Prints the `args` to the `stdout`, followed by a new line character (`\n`).
|
|
19
15
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
16
|
+
* Please note that this method bypasses any indentation as it's intended
|
|
17
|
+
* to be used to print separator lines, etc.
|
|
22
18
|
*
|
|
23
|
-
* @param {...any[]} args
|
|
24
|
-
*
|
|
25
|
-
* @returns {void}
|
|
26
19
|
*/
|
|
27
20
|
println(...args: any[]): void {
|
|
28
21
|
return this.print(...args, '\n');
|
|
29
22
|
}
|
|
30
23
|
|
|
31
24
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* the current indentation level.
|
|
35
|
-
*
|
|
36
|
-
* @param {...any[]} args
|
|
37
|
-
*
|
|
38
|
-
* @returns {void}
|
|
25
|
+
* Prints the `args` to the `stdout`, indenting the output according to
|
|
26
|
+
* the current indentation level.
|
|
39
27
|
*/
|
|
40
28
|
print(...args: any[]): void {
|
|
41
29
|
this.stdout.write(
|
|
@@ -44,20 +32,14 @@ export class Printer {
|
|
|
44
32
|
}
|
|
45
33
|
|
|
46
34
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Increases the current indentation by 2 spaces.
|
|
49
|
-
*
|
|
50
|
-
* @returns {void}
|
|
35
|
+
* Increases the current indentation by 2 spaces.
|
|
51
36
|
*/
|
|
52
37
|
indent(): void {
|
|
53
38
|
this.indentation.increase();
|
|
54
39
|
}
|
|
55
40
|
|
|
56
41
|
/**
|
|
57
|
-
*
|
|
58
|
-
* Reduces the current indentation by 2 spaces.
|
|
59
|
-
*
|
|
60
|
-
* @returns {void}
|
|
42
|
+
* Reduces the current indentation by 2 spaces.
|
|
61
43
|
*/
|
|
62
44
|
outdent(): void {
|
|
63
45
|
this.indentation.decrease();
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { Outcome } from '@serenity-js/core/lib/model';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* print output in colour.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
* @abstract
|
|
4
|
+
* Decorates text with control characters to make the terminal
|
|
5
|
+
* print output in colour.
|
|
10
6
|
*/
|
|
11
7
|
export abstract class TerminalTheme {
|
|
12
8
|
abstract heading(...parts: any[]): string;
|
|
@@ -15,30 +11,15 @@ export abstract class TerminalTheme {
|
|
|
15
11
|
abstract log(...parts: any[]): string;
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Converts the `parts` to `string` and joins them together.
|
|
20
|
-
*
|
|
21
|
-
* @protected
|
|
22
|
-
*
|
|
23
|
-
* @param {any[]} parts
|
|
24
|
-
*
|
|
25
|
-
* @returns {string}
|
|
14
|
+
* Converts the `parts` to `string` and joins them together.
|
|
26
15
|
*/
|
|
27
16
|
protected joined(parts: any[]): string {
|
|
28
17
|
return parts.map(String).join('');
|
|
29
18
|
}
|
|
30
19
|
|
|
31
20
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* Used to produce separator lines.
|
|
35
|
-
*
|
|
36
|
-
* @protected
|
|
37
|
-
*
|
|
38
|
-
* @param {string} pattern
|
|
39
|
-
* @param {number} [maxLength=80] maxLength
|
|
40
|
-
*
|
|
41
|
-
* @returns {string}
|
|
21
|
+
* Repeats a given `pattern` so that it takes up to `maxLength` characters.
|
|
22
|
+
* Used to produce separator lines.
|
|
42
23
|
*/
|
|
43
24
|
protected repeat(pattern: string, maxLength = 80): string {
|
|
44
25
|
if (! pattern) {
|
|
@@ -4,14 +4,8 @@ import type { Chalk } from 'chalk'; // eslint-disable-line unicorn/import-style
|
|
|
4
4
|
import { TerminalTheme } from './TerminalTheme';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* to print to terminals that support colour output.
|
|
10
|
-
*
|
|
11
|
-
* @extends {TerminalTheme}
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
* @abstract
|
|
7
|
+
* Base class for `TerminalTheme` implementations intended
|
|
8
|
+
* to print to terminals that support colour output.
|
|
15
9
|
*/
|
|
16
10
|
export abstract class ThemeForColourTerminals extends TerminalTheme {
|
|
17
11
|
|
|
@@ -26,10 +20,10 @@ export abstract class ThemeForColourTerminals extends TerminalTheme {
|
|
|
26
20
|
|
|
27
21
|
/**
|
|
28
22
|
* Joins the `parts` into a single string and decorates it
|
|
29
|
-
* using a colour appropriate for a given
|
|
23
|
+
* using a colour appropriate for a given `Outcome`.
|
|
30
24
|
*
|
|
31
25
|
* @param outcome
|
|
32
|
-
* an instance of an
|
|
26
|
+
* an instance of an `Outcome`
|
|
33
27
|
* or a string class name of one of its implementations.
|
|
34
28
|
*
|
|
35
29
|
* @param parts
|
|
@@ -3,12 +3,7 @@ import type { Chalk } from 'chalk'; // eslint-disable-line unicorn/import-style
|
|
|
3
3
|
import { ThemeForColourTerminals } from './ThemeForColourTerminals';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* A simple colour theme for terminals with dark backgrounds.
|
|
8
|
-
*
|
|
9
|
-
* @extends {ThemeForColourTerminals}
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
6
|
+
* A simple colour theme for terminals with dark backgrounds.
|
|
12
7
|
*/
|
|
13
8
|
export class ThemeForDarkTerminals extends ThemeForColourTerminals {
|
|
14
9
|
|
|
@@ -22,38 +17,27 @@ export class ThemeForDarkTerminals extends ThemeForColourTerminals {
|
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Formats the heading
|
|
20
|
+
* Formats the heading
|
|
27
21
|
*
|
|
28
|
-
* @param
|
|
22
|
+
* @param parts
|
|
29
23
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
30
|
-
*
|
|
31
|
-
* @returns {string}
|
|
32
24
|
*/
|
|
33
25
|
heading(...parts: any[]): string {
|
|
34
26
|
return this.chalk.bold.white(this.joined(parts));
|
|
35
27
|
}
|
|
36
28
|
|
|
37
29
|
/**
|
|
38
|
-
*
|
|
39
|
-
* Decorates the heading with theme colours.
|
|
30
|
+
* Decorates the heading with theme colours.
|
|
40
31
|
*
|
|
41
|
-
* @param
|
|
32
|
+
* @param pattern
|
|
42
33
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
43
|
-
*
|
|
44
|
-
* @returns {string}
|
|
45
34
|
*/
|
|
46
35
|
separator(pattern: string): string {
|
|
47
36
|
return this.chalk.yellow(this.repeat(pattern));
|
|
48
37
|
}
|
|
49
38
|
|
|
50
39
|
/**
|
|
51
|
-
*
|
|
52
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
53
|
-
*
|
|
54
|
-
* @param {...any[]} parts
|
|
55
|
-
*
|
|
56
|
-
* @returns {string}
|
|
40
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
57
41
|
*/
|
|
58
42
|
log(...parts: any[]): string {
|
|
59
43
|
return this.chalk.yellow(this.joined(parts));
|
|
@@ -3,18 +3,11 @@ import type { Chalk } from 'chalk'; // eslint-disable-line unicorn/import-style
|
|
|
3
3
|
import { ThemeForColourTerminals } from './ThemeForColourTerminals';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* A simple colour theme for terminals with light backgrounds.
|
|
8
|
-
*
|
|
9
|
-
* @extends {ThemeForColourTerminals}
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
6
|
+
* A simple colour theme for terminals with light backgrounds.
|
|
12
7
|
*/
|
|
13
8
|
export class ThemeForLightTerminals extends ThemeForColourTerminals {
|
|
14
9
|
|
|
15
10
|
/**
|
|
16
|
-
* @param {chalk~Chalk} chalk
|
|
17
|
-
*
|
|
18
11
|
* @see https://www.npmjs.com/package/chalk
|
|
19
12
|
*/
|
|
20
13
|
constructor(chalk: Chalk) {
|
|
@@ -22,38 +15,29 @@ export class ThemeForLightTerminals extends ThemeForColourTerminals {
|
|
|
22
15
|
}
|
|
23
16
|
|
|
24
17
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Decorates the heading with theme colours.
|
|
18
|
+
* Decorates the heading with theme colours.
|
|
27
19
|
*
|
|
28
|
-
* @param
|
|
20
|
+
* @param parts
|
|
29
21
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
30
|
-
*
|
|
31
|
-
* @returns {string}
|
|
32
22
|
*/
|
|
33
23
|
heading(...parts: any[]): string {
|
|
34
24
|
return this.chalk.bold.black(this.joined(parts));
|
|
35
25
|
}
|
|
36
26
|
|
|
37
27
|
/**
|
|
38
|
-
*
|
|
39
|
-
* Decorates the heading with theme colours.
|
|
28
|
+
* Decorates the heading with theme colours.
|
|
40
29
|
*
|
|
41
|
-
* @param
|
|
30
|
+
* @param pattern
|
|
42
31
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
43
|
-
*
|
|
44
|
-
* @returns {string}
|
|
45
32
|
*/
|
|
46
33
|
separator(pattern: string): string {
|
|
47
34
|
return this.repeat(pattern);
|
|
48
35
|
}
|
|
49
36
|
|
|
50
37
|
/**
|
|
51
|
-
*
|
|
52
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
53
|
-
*
|
|
54
|
-
* @param {...any[]} parts
|
|
38
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
55
39
|
*
|
|
56
|
-
* @
|
|
40
|
+
* @param parts
|
|
57
41
|
*/
|
|
58
42
|
log(...parts: any[]): string {
|
|
59
43
|
return this.joined(parts);
|
|
@@ -3,23 +3,15 @@ import type { Outcome } from '@serenity-js/core/lib/model';
|
|
|
3
3
|
import { TerminalTheme } from './TerminalTheme';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* A simple colour theme for terminals with no colour support.
|
|
8
|
-
*
|
|
9
|
-
* @extends {TerminalTheme}
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
6
|
+
* A simple colour theme for terminals with no colour support.
|
|
12
7
|
*/
|
|
13
8
|
export class ThemeForMonochromaticTerminals extends TerminalTheme {
|
|
14
9
|
|
|
15
10
|
/**
|
|
16
|
-
*
|
|
17
|
-
* Formats the heading
|
|
11
|
+
* Formats the heading
|
|
18
12
|
*
|
|
19
|
-
* @param
|
|
13
|
+
* @param parts
|
|
20
14
|
* `parts` to be converted to string, joined together, and formatted as a heading
|
|
21
|
-
*
|
|
22
|
-
* @returns {string}
|
|
23
15
|
*/
|
|
24
16
|
heading(...parts: any[]): string {
|
|
25
17
|
return this.joined(parts);
|
|
@@ -31,38 +23,30 @@ export class ThemeForMonochromaticTerminals extends TerminalTheme {
|
|
|
31
23
|
* no decoration of the text is performed.
|
|
32
24
|
*
|
|
33
25
|
* @param outcome
|
|
34
|
-
* an instance of an
|
|
26
|
+
* an instance of an `Outcome`
|
|
35
27
|
* or a string class name of one of its implementations.
|
|
36
28
|
*
|
|
37
29
|
* @param parts
|
|
38
30
|
* the parts of the message
|
|
39
|
-
*
|
|
40
|
-
* @returns {string}
|
|
41
31
|
*/
|
|
42
32
|
outcome(outcome: Outcome, ...parts: any[]): string {
|
|
43
33
|
return this.joined(parts);
|
|
44
34
|
}
|
|
45
35
|
|
|
46
36
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Decorates the heading with theme colours.
|
|
37
|
+
* Decorates the heading with theme colours.
|
|
49
38
|
*
|
|
50
|
-
* @param
|
|
39
|
+
* @param pattern
|
|
51
40
|
* The pattern to be repeated to create a separator, for example `-`, `✂ - - `, etc.
|
|
52
|
-
*
|
|
53
|
-
* @returns {string}
|
|
54
41
|
*/
|
|
55
42
|
separator(pattern: string): string {
|
|
56
43
|
return this.repeat(pattern);
|
|
57
44
|
}
|
|
58
45
|
|
|
59
46
|
/**
|
|
60
|
-
*
|
|
61
|
-
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
62
|
-
*
|
|
63
|
-
* @param {...any[]} parts
|
|
47
|
+
* Decorates the log entries that the developer wanted to have captured in the output.
|
|
64
48
|
*
|
|
65
|
-
* @
|
|
49
|
+
* @param parts
|
|
66
50
|
*/
|
|
67
51
|
log(...parts: any[]): string {
|
|
68
52
|
return this.joined(parts);
|