Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d8801f

Browse files
fix(ngScenario): fix error message description
1 parent 301647b commit 8d8801f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/ngScenario/Scenario.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,17 @@ angular.scenario.dsl = angular.scenario.dsl || function(name, fn) {
6969
*/
7070
angular.scenario.matcher = angular.scenario.matcher || function(name, fn) {
7171
angular.scenario.matcher[name] = function(expected) {
72-
var prefix = 'expect ' + this.future.name + ' ',
73-
not = this.inverse && 'not ';
72+
var description = this.future.name +
73+
(this.inverse ? ' not ' : ' ') + name +
74+
' ' + angular.toJson(expected);
7475
var self = this;
75-
this.addFuture(prefix + not + name + ' ' + angular.toJson(expected),
76+
this.addFuture('expect ' + description,
7677
function(done) {
7778
var error;
7879
self.actual = self.future.value;
7980
if ((self.inverse && fn.call(self, expected)) ||
8081
(!self.inverse && !fn.call(self, expected))) {
81-
error = 'expected ' + not + name + ' ' + angular.toJson(expected) +
82+
error = 'expected ' + description +
8283
' but was ' + angular.toJson(self.actual);
8384
}
8485
done(error);

0 commit comments

Comments
 (0)