mercredi 27 juillet 2016

Ember mirage server is not defined in tests

I am trying to integrate ember-cli-mirage fixtures into some tests. I followed the documentation here: ember fixtures

Problem: The server is not defined. error message: ReferenceError: server is not defined

model-test.js:

import { moduleForModel, test } from 'ember-qunit';

moduleForModel('network', 'Unit | Model | network', {
  needs: []
});

test('it exists', function(assert) {
  server.loadFixtures('networks'); //no defined

andThen(function() {
   let net1 = networks.first();
});
  assert.ok(true);
});

I have also verified that the config is set to true.

ENV['ember-cli-mirage'] = {
        enabled: true
    }




Aucun commentaire:

Enregistrer un commentaire