【发布时间】:2015-02-14 10:30:54
【问题描述】:
我正在使用 ember-cli / ember-cli-mocha 进行测试。当我通过ember serve 运行我的应用程序时,我已经生成了可以工作的 http-mock。然而,当我运行我的测试时——(例如,见下文......),我得到了错误:
Sheet calculates exported fields
✘ Assertion Failed: Unable to find fixtures for model type (subclass of DS.Model). If you're defining your fixtures using `Model.FIXTURES = ...`, please change it to `Model.reopenClass({ FIXTURES: ... })`.
我认为单元测试设置必须将商店设置为使用固定装置。是否有配置可以使用 http-mocks 代替?
测试开始...
it 'calculates exported fields', ->
# now, exported fields are all fields and variables
expected = `new Set()`
sheet = null
store = @store()
Ember.run ->
store.find('sheet', '1').then( (sheet_)->
sheet = sheet_
Promise.all([ sheet.get('fields'), sheet.get('formulas')])
).then((args)->
[fields, formulas] = args
fields.forEach (f)->expected.add(f)
...
【问题讨论】:
标签: unit-testing ember.js mocha.js ember-cli