Skip to content

Commit

Permalink
fix(gemini-test-adapter): method hasDiff should return false for error
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod committed Mar 22, 2018
1 parent 5306c37 commit ed0cc7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/test-adapter/gemini-test-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = class GeminiTestResultAdapter extends TestAdapter {
}

hasDiff() {
return !this._testResult.equal;
return this._testResult.hasOwnProperty('equal') && !this._testResult.equal;
}

get error() {
Expand Down
10 changes: 5 additions & 5 deletions test/lib/test-adapter/gemini-test-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ describe('gemini test adapter', () => {
assert.isFalse(geminiTestAdapter.hasDiff());
});

it('should return "true" if test failed', () => {
const geminiTestAdapter = new GeminiTestResultAdapter({equal: false});
it('should return "false" if test errored (does not have image comparison result)', () => {
const geminiTestAdapter = new GeminiTestResultAdapter({});

assert.isTrue(geminiTestAdapter.hasDiff());
assert.isFalse(geminiTestAdapter.hasDiff());
});

it('should return "true" if test errored (does not have image comparison result)', () => {
const geminiTestAdapter = new GeminiTestResultAdapter({});
it('should return "true" if test failed', () => {
const geminiTestAdapter = new GeminiTestResultAdapter({equal: false});

assert.isTrue(geminiTestAdapter.hasDiff());
});
Expand Down

0 comments on commit ed0cc7b

Please sign in to comment.