mardi 27 septembre 2016

Ember integration test setup() not being called

I'm trying to follow these instructions to initialize a service in an Ember component integration test. However, it appears that setup() is never called and the tests fail. However, I can add that same code to the beforeEach() function and I can see that it was called and the tests pass.

moduleForComponent('header-editor', 'Integration | Component | header editor', {
  integration: true,
  setup () {
    // manually invoke the ember-intl initializer
    instanceInitializer.initialize(this);
    let intl = this.container.lookup('service:intl');
    // this log statement will NOT appear in the console
    console.log('setup', intl);
    intl.setLocale('en-us');
  },
  beforeEach () {
    // // manually invoke the ember-intl initializer
    instanceInitializer.initialize(this);
    let intl = this.container.lookup('service:intl');
    // this log statement appears in the console
    console.log('beforeEach', intl);
    intl.setLocale('en-us');
  }
});

Does anyone know why setup() would not be called?

Aucun commentaire:

Enregistrer un commentaire