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
Calculating anything based on now ( which is equal to Date.now() in some projects) in contact-summary-extras.js and then using static expected json file will eventually fail. As this is a cli I guess we could pass a parameter in to change the date or maybe get rid of the cli and make it a framework that's imported. Then use it within mocha or maybe there's some other magic in JS that could happen. @abbyad is there a reason we went CLI? I personally think it would be an easy change to set now to whatever the expected date was if we used it more in a framework style.
This would be an issue in standard config for the immunizations contact summary. The contacts birth is set to "2018-01-03" and immunizations checks that DOB in months to be less than 144. Eventually that contact would be over 144 months old.
In CHT config we are comparing lmpDate > now - 294 * MS_IN_DAY to insure that the pregnancy is within 9 months. Once the Date.now() is past that threshold the tests would begin to fail.
The text was updated successfully, but these errors were encountered:
Seems worth making this easier to use, but I am not clear on what you mean by "framework style". Can you propose what you think it should be like, and provide an example?
You'd use this similar to any other npm package. As in you'd setup a standard mocha test and then require in contact-summary-testing and pass use it within mocha instead of having it loop over a folder structure.
newtewt
changed the title
Need ability to set dates calculated in either contact-summary-extras.js or possibly in the supplied json files.
Setting dates in expected output and input files can become stale due to not being able to set expected dates when tests run.
Jul 18, 2019
As in you'd setup a standard mocha test and then require in contact-summary-testing
Should we merge this into medic-conf-test-harness then? It already has functionality for mocking the expected date in xforms, tasks, and targets code. Sounds like a good fit.
@kennsippell I think that'd be a good idea. It'd be one less repo to manage and all testing stuff would live in one place. I know @abbyad mentioned we would want to make this more friendly for non programmer style persons.
@binokaryg found this issue.
Calculating anything based on
now
( which is equal to Date.now() in some projects) in contact-summary-extras.js and then using static expected json file will eventually fail. As this is a cli I guess we could pass a parameter in to change the date or maybe get rid of the cli and make it a framework that's imported. Then use it within mocha or maybe there's some other magic in JS that could happen. @abbyad is there a reason we went CLI? I personally think it would be an easy change to set now to whatever the expected date was if we used it more in a framework style.This would be an issue in standard config for the immunizations contact summary. The contacts birth is set to "2018-01-03" and immunizations checks that DOB in months to be less than 144. Eventually that contact would be over 144 months old.
In CHT config we are comparing lmpDate > now - 294 * MS_IN_DAY to insure that the pregnancy is within 9 months. Once the Date.now() is past that threshold the tests would begin to fail.
The text was updated successfully, but these errors were encountered: