Unit testing 使用http模拟的ember cli/ember数据模型单元测试

Unit testing 使用http模拟的ember cli/ember数据模型单元测试,unit-testing,ember.js,mocha.js,ember-cli,Unit Testing,Ember.js,Mocha.js,Ember Cli,我正在使用ember cli/ember cli摩卡进行测试。当我通过ember-service运行我的应用程序时,我已经生成了http模拟。但是,当我运行我的测试时--(例如,见下文…),我会得到错误: Sheet calculates exported fields ✘ Assertion Failed: Unable to find fixtures for model type (subclass of DS.Model). If you're defining your fi

我正在使用ember cli/ember cli摩卡进行测试。当我通过
ember-service
运行我的应用程序时,我已经生成了http模拟。但是,当我运行我的测试时--(例如,见下文…),我会得到错误:

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: ... })`.
我假定单元测试设置必须将存储设置为使用fixture。是否有使用http模拟的配置


开始测试

  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)
        ...

答案在ember cli主页上:

模拟只是为了开发。整个/server目录将被删除 在余烬构建和余烬测试期间忽略

但是,Ember.js有一个插件: