Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework on reactivity unittest #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

illuminist
Copy link

Background:
I have a re-implement test tap-i18n-db in javascript which is also tap:i18n independent. In order to verify original functionality, I need to user original unittest in my implementation. The problem is reactivity tests take so long time to run so I reworked them to make them become faster.

What I have done

  • Original reactivity unittest depends on timer to check tracker ( Deps in this case because they are old implementation. In my case, I changed them to Tracker ) which would waste so much time waiting for the timer.
    The new unittest depends on Meteor.subcribe.ready() which will become not ready when tracker become invalidate and back to ready again when new data have arrived.
    The new running time are
    • 490 ms for simple subscription ( originally around 2500 ms )
    • 2096 ms for complex subscription ( originally around 60000 ms )
  • Complex reactivity test cases has been change to pre-generated test cases instead of the original "change-on-the-run" for more readiness.

Disclaimer
I haven't been testing on implementation with tap:i18n, only with mocked tap:i18n because the original one seem to be broken as hell, along with some modification in unittest starter file to include some missing dependencies. I had modified and run this test in Meteor 1.7.0.5. Even though the other part of unittests are also broken because the changes in the last 3-4 years which I have fixed in JS re-implementation. But this rework seem to be pretty useful in general so I submitted this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant