Skip to content

Commit

Permalink
Merge fd40944 into abfcace
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed May 14, 2015
2 parents abfcace + fd40944 commit 9d1987d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions lib/Unexpected.js
Expand Up @@ -128,7 +128,8 @@ function writeGroupEvaluationsToOutput(expect, output, groupEvaluations) {
if (j > 0) {
output.jsComment(' and').nl();
}
if (evaluation.promise.isRejected() && !groupFailed) {
var isRejected = evaluation.promise.isRejected();
if (isRejected && !groupFailed) {
groupFailed = true;
var err = evaluation.promise.reason();

Expand All @@ -147,9 +148,9 @@ function writeGroupEvaluationsToOutput(expect, output, groupEvaluations) {
});
} else {
var style;
if (groupFailed) {
style = 'text';
output.sp(2);
if (isRejected) {
style = 'error';
output.error('⨯ ');
} else {
style = 'success';
output.success('✓ ');
Expand Down
10 changes: 5 additions & 5 deletions test/unexpected.spec.js
Expand Up @@ -2822,7 +2822,7 @@ describe('unexpected', function () {
"⨯ expected 123 when delayed a little bit to equal 456\n" +
"or\n" +
"⨯ expected 123 when delayed a little bit to be a string and\n" +
" expected 123 to be greater than 100\n" +
" expected 123 to be greater than 100\n" +
"or\n" +
"✓ expected 123 when delayed a little bit 'to be a number' and\n" +
"⨯ expected 123 when delayed a little bit to be within 100, 110"
Expand Down Expand Up @@ -4615,7 +4615,7 @@ describe('unexpected', function () {
}, 'to throw',
"✓ expected 20 to be a number and\n" +
"⨯ expected 20 to be less than 14 and\n" +
" expected 20 to be negative");
" expected 20 to be negative");
});

it('returns a new function', function () {
Expand Down Expand Up @@ -4664,7 +4664,7 @@ describe('unexpected', function () {
expectation('foobarbaz');
}, 'to throw',
"⨯ expected 'foobarbaz' to be a number and\n" +
" expected 'foobarbaz' to be greater than 6\n" +
" expected 'foobarbaz' to be greater than 6\n" +
"or\n" +
"✓ expected 'foobarbaz' to be a string and\n" +
"⨯ expected 'foobarbaz' to have length 6\n" +
Expand Down Expand Up @@ -4758,7 +4758,7 @@ describe('unexpected', function () {
'to be rejected',
'⨯ expected false to be a number after a short delay and\n' +
' expected false to be a number\n' +
' expected false to be finite after a short delay'
' expected false to be finite after a short delay'
);
});
});
Expand All @@ -4780,7 +4780,7 @@ describe('unexpected', function () {
'to be rejected',
'⨯ expected false to be a number after a short delay and\n' +
' expected false to be a number\n' +
' expected false to be finite after a short delay\n' +
' expected false to be finite after a short delay\n' +
'or\n' +
'⨯ expected false to be a string after a short delay\n' +
' expected false to be a string'
Expand Down

0 comments on commit 9d1987d

Please sign in to comment.