javascript - Why following test doesn't pass? -
I have the following EmberJS / Konacha code. Does anyone have any clue why does not pass the test?
Edit:
I've added a test case that checks the attribute value instead of the context.
# = Required ../spec_helper "Zaptax.v2014.App.AnswersLookup", - & gt; First of all (-> Test.store = TestUtil.lookupStore ()) it gets 'answers by context', - & gt; Page = Test.store.push Zaptax.v2014.App.PageModel, {id: 666, sequence: 123} assert.equal Test.store.find ('Page', 666) .get ('sequence'), 123
returns:
unsuccessful: reference zaptax.v2014.App.AnswersLookup provides answers by reference: Undefined expected 123 equals
It seems that you are trying to test the similarity of two objects - it will always change false. For example: var a = {}; Var B = {}; Emphasis (A === B); // false
What you probably need to do is check that the value of the properties of the object is equal to the series of claims instead.
var a = {name: 'Bob'}; Var B = {Name: 'Bob'}; Emphasis (a.name === b.name); // true
Comments
Post a Comment