alanning / meteor-package-stubber

Auto-stubber for Meteor smart packages
MIT License
5 stars 3 forks source link

Zepto #12

Open tomitrescak opened 10 years ago

tomitrescak commented 10 years ago

What is Zepto included in generated package stub "a1-package-stubs.js"? Now, I have to override the jquery behaviour in every fixture, while I would prefer to do it only once and stub it myself in "custom-stub.js". This way, the package stubber is overriding it :/

tomitrescak commented 10 years ago

It seems like it is there to stub the jquery, yet I do not understand how could it be used, since selectors still try to do the getElementById. Thanks.

alanning commented 10 years ago

Yes, it's there to provide jquery-compatible functionality since we have run into some popular packages that expect it to be there.

Custom stubs are loaded last so you should be able to override it once in a custom stub.

We are working on merging the jasmine and jasmine-unit packages and as part of that we will remove the need for this stub by only loading server-side code.

On Aug 23, 2014, at 1:45 AM, Tomas Trescak notifications@github.com wrote:

It seems like it is there to stub the jquery, yet I do not understand how could it be used, since selectors still try to do the getElementById. Thanks.

— Reply to this email directly or view it on GitHub.

tomitrescak commented 10 years ago

I commented out the Zepto functionality in package stubber and only then I could stub the jquery. Out if curiosity, how will the merged jasmine work after the merge? Now I'm using them for completely different purposes - jasmine-unit works flawlessly for unit testing and jasmine for integration testing, since it gives me access to the whole Meteor API and application. What can I expect after the merge? I am writing quite a lot of unit and integration tests, so it would be great to know. Kindly appreciated.

alanning commented 10 years ago

Hmm, that's funny. We named the stub file "a1-..." so it would be loaded before the other files based on meteor's load order. Not sure what's going on there.

Re: merging the packages, the jasmine-unit package won't go away so if it's working for you no need to change it. It provides some support for both client-side and server-side unit tests whereas the merged one will only support server-side for now.

Eventually the jasmine-unit package will be deprecated once jasmine supports all the same functionality.

No changes to your test scripts required. The only change will be where you put them. Server-side unit tests will go to this directory after the merge:

tests/jasmine/server/unit

Integration tests will go in:

tests/jasmine/server/integration

Out of curiosity what kind of client-side unit tests are you doing?

Sent from my phone

On Aug 23, 2014, at 12:10 PM, Tomas Trescak notifications@github.com wrote:

I commented out the Zepto functionality in package stubber and only then I could stub the jquery. Out if curiosity, how will the merged jasmine work after the merge? Now I'm using them for completely different purposes - jasmine-unit works flawlessly for unit testing and jasmine for integration testing, since it give me access to the whole Meteor API and application. What can I expect after the merge? I am writing quite a lot of unit and integration tests, so it would be great to know. Kindly appreciated.

— Reply to this email directly or view it on GitHub.

tomitrescak commented 10 years ago

I have created a blog post where I describe some tests I'm doing on client and server: https://doctorllama.wordpress.com/2014/08/03/creating-and-testing-meteor-applications-with-bdd-using-velocity-and-jasmine/

To summarise:

Jasmine-unit:

Jasmine:

In general I try to test as much as possible with jasmine-unit, since it's much (much) faster and reliable than jasmine, which depends on the mirror that seems to have lot of issues and many times it won't even start or I have to wait several seconds to obtain results. With jasmine-unit test results are instant. If you guys will stabilize jasmine, it will be fantastic. Let me know if I can be of any help.

With that tutorial I tried also get some answers yet I had no luck.

alanning commented 10 years ago

Thanks @tomitrescak, it's really helpful to learn how this is being used! Nice job with the blog post too!