-
Notifications
You must be signed in to change notification settings - Fork 38
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
Running Client before Server #116
Comments
You can do it with our var assert = require("assert");
suite("Post", function() {
test("publish a new post", function(done, server, client) {
client.evalSync(function() {
Post.insert({message: "hi!"}, function() {
emit('return');
});
});
var docs = server.evalSync(function() {
var docs = Post.find().fetch();
emit('return', docs);
});
assert.equal(docs[0].message, "hi!");
done();
});
}); And for the login, you can create a user on every test. Like below.
may be you can create a common function for this, where you can use in any testCase you want. |
This is my new book about Meteor https://casadocodigo.refersion.com/l/d88.3525 (Brazilian portuguese) today is on beta version, but in the full version it will have a chapter about testing using laika and thats why I requested a help here :) Thanks @arunoda !! |
Awesome. Yep, I'll help. |
Hi again!
Is there a way to simulate a client execution first and server assert after?
For exemple, only clients can publish a post, so it'll be something like...
I have some functions which only client can execute (because it needs a logged user), and I don't know how to simulate this kind of test.
I will wait some answer, Thanks!
The text was updated successfully, but these errors were encountered: