Closed
Bug 1061290
Opened 10 years ago
Closed 10 years ago
gaia:test_agent add chai expect and should interface
Categories
(Firefox OS Graveyard :: Gaia::TestAgent, defect)
Firefox OS Graveyard
Gaia::TestAgent
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sv99, Assigned: sv99)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36 Steps to reproduce: chia enable only assert interface, not enabled expect and should interfaces For testing existing property in objects used assert.include, specified for string and array, not for simple object. dev_apps/test-agent/common/test/helper.js View @@ -111,6 +111,8 @@ chai.Assertion.includeStack = true; patchChai(chai.Assertion); window.assert = chai.assert; + window.expect = chai.expect; + window.should = chai.should(); }); Actual results: sample using assert.include apps/clock/test/unit/picker/picker_test.js View test('shape:prototype ', function() { assert.ok(Picker); assert.include(Picker.prototype, 'reset'); + assert.include(Picker.prototype, 'reset1'); // assert OK!! this property not exists !! assert.include(Picker.prototype, 'value'); assert.isNull(Picker.prototype.value); }); Expected results: apps/clock/test/unit/picker/picker_test.js View @@ -15,7 +15,10 @@ suite('Picker', function() { test('shape:prototype ', function() { assert.ok(Picker); + expect(Picker.prototype).to.have.property('reset'); + Picker.prototype.should.to.have.property('value'); assert.isNull(Picker.prototype.value); });
Summary: gaia:test_agent add chia expect and should interface → gaia:test_agent add chai expect and should interface
Attachment #8482551 -
Flags: review?(yurenju.mozilla)
Comment 6•10 years ago
|
||
Comment on attachment 8482551 [details] [review] PR that looks good, but we should have a test case to catch it, I will upload a attchment for test case, please apply it to your pull request and squash to one commit and needinfo? me if your pull request is updated. thanks for your contribution!
Attachment #8482551 -
Flags: review?(yurenju.mozilla) → review+
Updated•10 years ago
|
Assignee: nobody → sv99
Attachment #8484123 -
Flags: review?(yurenju.mozilla)
Comment 8•10 years ago
|
||
Comment on attachment 8484123 [details] [review] PR I forgot to upload my patch yesterday and you test case looks good so let's land your pull request, thank you!
Attachment #8484123 -
Flags: review?(yurenju.mozilla) → review+
Comment 9•10 years ago
|
||
sv99, please squash commits in your pull request to one commit for merging.
Flags: needinfo?(sv99)
Assignee | ||
Comment 10•10 years ago
|
||
(In reply to Yuren [:yurenju] from comment #9) > sv99, please squash commits in your pull request to one commit for merging. commit squashed
Flags: needinfo?(sv99)
Comment 11•10 years ago
|
||
merged, thanks for this contribution! https://github.com/mozilla-b2g/gaia/commit/df383142490620d259e7a7b4a0a46a930242a339
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 12•10 years ago
|
||
I'm not sure we should support "should", it looks quite useless in our cases (see my comment on the commit).
Flags: needinfo?(yurenju)
Comment 13•10 years ago
|
||
replied on github. https://github.com/mozilla-b2g/gaia/commit/df383142490620d259e7a7b4a0a46a930242a339#commitcomment-7793014
Flags: needinfo?(yurenju)
You need to log in
before you can comment on or make changes to this bug.
Description
•