You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I've used this add-on for a long time and I has served my needs perfectly.
However, one thing that I'd like to see included in this add-on is a helper to freeze moment (i.e. override moment.now) in tests, namely acceptance tests. Below I show what the API could look like:
import{module,test}from'qunit';import{setupRenderingTest}from'ember-qunit';import{render}from'@ember/test-helpers';importhbsfrom'htmlbars-inline-precompile';import{setupMoment}from'ember-moment/test-support';module('Integration | Component | x-event/date',function(hooks){setupRenderingTest(hooks);setupMoment(hooks,'2042-01-01');test('it renders',asyncfunction(assert){// This component only displays today's date in the format "DD/MM/YYYY"awaitrender(hbs`{{x-event/date}}`);assert.dom(this.element).hasText('01/01/2042');});});
This would allow (more) deterministic tests, instead of relying of always getting today's date to see if the behaviour(s) is(are) correct.
What do you think about this feature? Thanks! 😄
The text was updated successfully, but these errors were encountered:
Hey! I've used this add-on for a long time and I has served my needs perfectly.
However, one thing that I'd like to see included in this add-on is a helper to freeze moment (i.e. override
moment.now
) in tests, namely acceptance tests. Below I show what the API could look like:This would allow (more) deterministic tests, instead of relying of always getting today's date to see if the behaviour(s) is(are) correct.
What do you think about this feature? Thanks! 😄
The text was updated successfully, but these errors were encountered: