lundi 11 avril 2016

why do these ember tests fail only on circleCI

i have integration tests for components that, when i run locally with testem, always pass 100%.

when i run them on circleCI, they fail sporadically, i.e., not consistently. the tests that fail randomly this way are all assert()s on an action being emitted from the component on a touch event.

the actions are emitted by components after an animation (run by Velocity.js) completes. i've set animationSpeed=0 and Velocity.mock = true for the tests so that there should be no delay.

here is a snippet of one of the tests in question. the failure is that the assert never gets called, so assert.expect(1) causes the failure.

seems like the test ends before the assert can be called. why does this happen only in circleCI running testem?

var testActionFromTap = function(label, selector, expectedValue) {
  test('action on tap %@ button'.fmt(label), function(assert) {
    assert.expect(1);
    this.set('dummyAction', (value) => {
      assert.equal(value, expectedValue, '%@ should be value of onSelectGender'.fmt(expectedValue));
    });
    this.render(hbs`{{ user/select-gender animationSpeed=0 onSelectGender=(action dummyAction)}}`);
    this.$('%@'.fmt(selector)).trigger('touchstart');
  });
};

Aucun commentaire:

Enregistrer un commentaire