2
votes

I am using ember-cli / ember-cli-mocha for testing. I have generated http-mock that work when I run my app via ember serve. However, when I run my tests -- (e.g. see below...), I get the error:

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: ... })`.

I presume that the unit test setup must set the store to use fixtures. Is there configuration somewhere to use http-mocks instead?


start of test ...

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

1 Answers

1
votes

Answer is on ember-cli home page:

Mocks are just for development. The entire /server directory will be ignored during ember build and ember test.

However, there is addon for Ember.js: ember-cli-testem-http-mocks