为什么下面的测试没有't通过

Why following test doesn't pass?

本文关键字:通过 测试 为什么      更新时间:2023-09-26

我有以下EmberJS/Konacha代码。有人知道为什么考试不及格吗?

编辑:

我添加了测试用例,它测试属性值而不是引用。

#= require ../spec_helper
describe "Zaptax.v2014.App.AnswersLookup", ->
  beforeEach( ->
    Test.store = TestUtil.lookupStore()
  )
  it 'finds the answer by reference', ->
    page = Test.store.push Zaptax.v2014.App.PageModel, {id: 666, sequence: 123}
    assert.equal Test.store.find('page', 666).get('sequence'), 123

退货:

Failed: Zaptax.v2014.App.AnswersLookup finds the answer by reference
  AssertionError: expected undefined to equal 123

看起来就像是在测试两个对象的相等性——这总是返回false。例如:

var a = {};
var b = {};
assert(a === b); // false

您可能需要做的是检查对象上属性的是否与一系列断言相等。

var a = { name: 'Bob' };
var b = { name: 'Bob' };
assert(a.name === b.name); // true