@serenity-js/serenity-bdd
Advanced tools
Comparing version 2.0.1-alpha.87 to 2.0.1-alpha.88
@@ -6,2 +6,19 @@ # Change Log | ||
## [2.0.1-alpha.88](https://github.com/jan-molak/serenity-js/compare/v2.0.1-alpha.87...v2.0.1-alpha.88) (2019-11-25) | ||
### Bug Fixes | ||
* **assertions:** Ensure correct 'actual' and 'expected' values are captured when an Expectation fail ([e503e55](https://github.com/jan-molak/serenity-js/commit/e503e55)) | ||
### Features | ||
* **console-reporter:** New and shiny ConsoleReporter module to replace the experimental ConsoleRepo ([689937d](https://github.com/jan-molak/serenity-js/commit/689937d)) | ||
* **serenity-bdd:** AssertionErrors are reported together with a diff of actual/expected ([6b7a55e](https://github.com/jan-molak/serenity-js/commit/6b7a55e)) | ||
## [2.0.1-alpha.87](https://github.com/jan-molak/serenity-js/compare/v2.0.1-alpha.86...v2.0.1-alpha.87) (2019-11-10) | ||
@@ -8,0 +25,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var chalk_1 = require("chalk"); | ||
var chalk = require("chalk"); | ||
/** | ||
@@ -13,6 +13,6 @@ * @package | ||
Printer.prototype.info = function (message) { | ||
this.out.write(chalk_1.default.green(message) + '\n'); | ||
this.out.write(chalk.green(message) + '\n'); | ||
}; | ||
Printer.prototype.error = function (message) { | ||
this.out.write(chalk_1.default.red(message) + '\n'); | ||
this.out.write(chalk.red(message) + '\n'); | ||
}; | ||
@@ -19,0 +19,0 @@ return Printer; |
@@ -9,2 +9,3 @@ import { DomainEvent } from '@serenity-js/core/lib/events'; | ||
protected readonly scenario: ScenarioDetails; | ||
private static readonly differ; | ||
constructor(scenario: ScenarioDetails); | ||
@@ -11,0 +12,0 @@ abstract worksFor(anotherScenario: ScenarioDetails): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var events_1 = require("@serenity-js/core/lib/events"); | ||
var io_1 = require("@serenity-js/core/lib/io"); | ||
var model_1 = require("@serenity-js/core/lib/model"); | ||
@@ -23,2 +24,8 @@ var tiny_types_1 = require("tiny-types"); | ||
.when(model_1.TextData, function (_) { return report.arbitraryDataCaptured(e.name, e.artifact.map(function (artifactContents) { return artifactContents.data; })); }) | ||
.when(model_1.LogEntry, function (_) { return report.arbitraryDataCaptured(e.name, e.artifact.map(function (artifactContents) { return artifactContents.data; })); }) | ||
.when(model_1.AssertionReport, function (_) { | ||
return report.arbitraryDataCaptured(e.name, e.artifact.map(function (artifactContents) { | ||
return SceneReportingStrategy.differ.diff(artifactContents.expected, artifactContents.actual); | ||
})); | ||
}) | ||
.when(model_1.JSONData, function (_) { return report.arbitraryDataCaptured(e.name, e.artifact.map(function (artifactContents) { return JSON.stringify(artifactContents, null, 4); })); }) | ||
@@ -31,2 +38,7 @@ .else(function (_) { return report; }); }) | ||
}; | ||
SceneReportingStrategy.differ = new io_1.AssertionReportDiffer({ | ||
expected: function (line) { return "+ " + line; }, | ||
actual: function (line) { return "- " + line; }, | ||
matching: function (line) { return " " + line; }, | ||
}); | ||
return SceneReportingStrategy; | ||
@@ -33,0 +45,0 @@ }()); |
{ | ||
"name": "@serenity-js/serenity-bdd", | ||
"version": "2.0.1-alpha.87", | ||
"version": "2.0.1-alpha.88", | ||
"description": "Serenity BDD reporter for Serenity/JS", | ||
@@ -47,3 +47,3 @@ "author": { | ||
"axios": "^0.19.0", | ||
"chalk": "^2.4.2", | ||
"chalk": "^3.0.0", | ||
"find-java-home": "^1.0.0", | ||
@@ -62,6 +62,6 @@ "progress": "^2.0.3", | ||
"@documentation/esdoc-template": "2.0.1-alpha.85", | ||
"@integration/testing-tools": "2.0.1-alpha.87", | ||
"@serenity-js/assertions": "2.0.1-alpha.87", | ||
"@serenity-js/core": "2.0.1-alpha.87", | ||
"@serenity-js/rest": "2.0.1-alpha.87", | ||
"@integration/testing-tools": "2.0.1-alpha.88", | ||
"@serenity-js/assertions": "2.0.1-alpha.88", | ||
"@serenity-js/core": "2.0.1-alpha.88", | ||
"@serenity-js/rest": "2.0.1-alpha.88", | ||
"@types/mocha": "^5.2.6", | ||
@@ -93,3 +93,3 @@ "@types/progress": "^2.0.3", | ||
}, | ||
"gitHead": "525dec73ce78e49a45f7464167c445c433c7da8d" | ||
"gitHead": "7bffdd9f1f79bc7d8437453d2b30611321d9a094" | ||
} |
@@ -1,2 +0,2 @@ | ||
import chalk from 'chalk'; | ||
import chalk = require('chalk'); | ||
@@ -3,0 +3,0 @@ /** |
@@ -11,3 +11,4 @@ import { | ||
} from '@serenity-js/core/lib/events'; | ||
import { Artifact, ArtifactType, HTTPRequestResponse, JSONData, Photo, ScenarioDetails, TextData } from '@serenity-js/core/lib/model'; | ||
import { AssertionReportDiffer } from '@serenity-js/core/lib/io'; | ||
import { Artifact, ArtifactType, AssertionReport, HTTPRequestResponse, JSONData, LogEntry, Photo, ScenarioDetails, TextData } from '@serenity-js/core/lib/model'; | ||
import { match } from 'tiny-types'; | ||
@@ -21,2 +22,8 @@ import { SceneReport } from '../reports'; | ||
private static readonly differ = new AssertionReportDiffer({ | ||
expected: line => `+ ${ line }`, | ||
actual: line => `- ${ line }`, | ||
matching: line => ` ${ line }`, | ||
}); | ||
constructor(protected readonly scenario: ScenarioDetails) { | ||
@@ -37,2 +44,8 @@ } | ||
.when(TextData, _ => report.arbitraryDataCaptured(e.name, e.artifact.map(artifactContents => artifactContents.data))) | ||
.when(LogEntry, _ => report.arbitraryDataCaptured(e.name, e.artifact.map(artifactContents => artifactContents.data))) | ||
.when(AssertionReport, _ => | ||
report.arbitraryDataCaptured(e.name, e.artifact.map(artifactContents => | ||
SceneReportingStrategy.differ.diff(artifactContents.expected, artifactContents.actual), | ||
)), | ||
) | ||
.when(JSONData, _ => report.arbitraryDataCaptured(e.name, e.artifact.map(artifactContents => JSON.stringify(artifactContents, null, 4)))) | ||
@@ -39,0 +52,0 @@ .else(_ => report)) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
245167
4132
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
Updatedchalk@^3.0.0