Meteor.collection.insert() allows for the use of a callback
as one of its arguments. To demonstrate, you can start a new Meteor project and execute the following code in the browser's console.
my_collection = new Meteor.Collection("myCollection");
my_collection.insert(
{some: "object"},
function() {
console.log("finished insertion");
})
However, when I try to include this code in a Laika test, the callback
parameter does not seem to be executed. Below is my testing code:
suite('testing Laika out', function() {
test('inserting into collection', function(done, server, client) {
client.eval(function() {
my_collection = new Meteor.Collection("myCollection");
my_collection.insert(
{some: "object"},
function() {
console.log("finished insertion");
done();
})
})
})
})
Does anyone know why the callback function isn't being triggered in this Laika test? This issue appears to extend beyond just Meteor.collection.insert()
.
(I am using Ubuntu 13.04, Meteor 0.7.0.1, Laika 0.3.1, PhantomJS 1.9.2-6)