Hello,
This is the file that I got here tests/jasmine/integration/test.js
In the variable data I have many things but I didn’t put anything here to not pollute the ticket.
describe('Games', function() {
beforeEach(function() {
Games.remove({});
});
it('Create a game', function() {
var data = {};
var nbGames = 0;
Meteor.call('gameInsert', data, function(error, result) {
if (error) {
console.log(error.message);
}
});
nbGames = Games.find().count();
expect(nbGames).toEqual(1);
});
});
This code doesn’t pass but this one below does :
describe('Games', function() {
beforeEach(function() {
Games.remove({});
});
it('Create a game', function() {
var data = {};
var nbGames = 0;
Games.insert(data);
nbGames = Games.find().count();
expect(nbGames).toEqual(1);
});
});
The Meteor.call() doesn’t add a document in the DB, is there a way to test methods ???
Thanks in advance for the help.