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

Add tests for userId being available in client functions and server methods #9

Closed
mizzao opened this issue Jul 25, 2013 · 4 comments
Closed

Comments

@mizzao
Copy link
Contributor

mizzao commented Jul 25, 2013

I like the new changes a lot and I think it may even call for a bump in the major version number :)

However, we are missing a few tests which were basically in the coffeescript file I had before. We should test that userId loads properly on client hooks (it didn't prior to this version) and also inside Meteor methods. You can add these to your existing test files as you see fit, but I have the same functionality inside client_server_userId_tests.coffee

Once that's done, it's probably time for a merge into master and mrt release!

Also, when running the current tests, this strange error appears in the server console as a result of calling the publish callback:

Exception from sub L46TDhKxTQHm5Bxpt TypeError: Cannot set property 'mNkv4Kqma6DZMyJxh' of undefined
    at Meteor.methods.tinytest/run.onReport (app/packages/tinytest/tinytest_server.js:50:38)
    at _.extend._report (app/packages/tinytest/tinytest.js:476:10)
    at test.run.totalTime [as onEvent] (app/packages/tinytest/tinytest.js:396:14)
    at _.extend.ok (app/packages/tinytest/tinytest.js:27:10)
    at _.extend.equal (app/packages/tinytest/tinytest.js:136:12)
    at Tinytest.addAsync.CollectionAfterFindOne.update.a (app/packages/collection-hooks/tests_userid_in_find_hooks_within_publish.js:74:10)
    at delegate (app/packages/collection-hooks/collection-hooks.js:19:12)
    at Meteor.Collection.findOne (app/packages/collection-hooks/collection-hooks.js:81:13)
    at Tinytest.addAsync.CollectionBeforeFind.update.a (app/packages/collection-hooks/tests_userid_in_find_hooks_within_publish.js:37:37)
    at Meteor.publish [as _handler] (app/packages/collection-hooks/collection-hooks.js:221:20)
@mizzao
Copy link
Contributor Author

mizzao commented Aug 2, 2013

Hi @matb33, what would you like done so we can merge the server-userId branch into master? I'd like to get a version of this on atmosphere so I can depend on it from other projects.

@matb33
Copy link
Collaborator

matb33 commented Aug 2, 2013

I simply haven't had the time -- overwhelmed with work at the moment. I quickly merged to master, let me know if you encounter any issues

@mizzao
Copy link
Contributor Author

mizzao commented Aug 2, 2013

Probably fine for now. The tests that I wrote test for userId on client and server outside of publish functions, which aren't otherwise covered right now. We can either reactivate them or move them to the file in Javascript. No rush on your part - we can deal with it when you're less busy.

@matb33
Copy link
Collaborator

matb33 commented Sep 11, 2013

Closing this, when we re-implement this functionality in the new version, we'll deal with this stuff again in a different context anyway

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

No branches or pull requests

2 participants