Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f8f8f75

Browse files
fix(ngScenario): fix error message description
1 parent 6c59e77 commit f8f8f75

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/ngScenario/Scenario.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,17 @@ angular.scenario.dsl = angular.scenario.dsl || function(name, fn) {
7474
*/
7575
angular.scenario.matcher = angular.scenario.matcher || function(name, fn) {
7676
angular.scenario.matcher[name] = function(expected) {
77-
var prefix = 'expect ' + this.future.name + ' ',
78-
not = this.inverse && 'not ';
77+
var description = this.future.name +
78+
(this.inverse ? ' not ' : ' ') + name +
79+
' ' + angular.toJson(expected);
7980
var self = this;
80-
this.addFuture(prefix + not + name + ' ' + angular.toJson(expected),
81+
this.addFuture('expect ' + description,
8182
function(done) {
8283
var error;
8384
self.actual = self.future.value;
8485
if ((self.inverse && fn.call(self, expected)) ||
8586
(!self.inverse && !fn.call(self, expected))) {
86-
error = 'expected ' + not + name + ' ' + angular.toJson(expected) +
87+
error = 'expected ' + description +
8788
' but was ' + angular.toJson(self.actual);
8889
}
8990
done(error);

0 commit comments

Comments
 (0)