Closed saurabhghewari closed 7 years ago
Hi @saurabhghewari
Unfortunately I could not reproduce your issue.
If you are willing to stick to the opinionated conventions that this project follows, testing seneca with Labbable is as easy as the adding the following to your tests;
it('has working services', (done) => {
server.seneca.act({ generate: 'id' }, (err, result) => {
expect(err).to.not.exist();
expect(result.id).to.equal(1);
done();
});
});
Sorry for late response. Thank you for the answer. I will give it a try.
Are you planing to migrate this project to Hapi 17 from Hapi 16?
Here you can find the documentation for latest hapi api. Hapi17
HI Franzip, I am nodejs developer and using this boilerplate for one of my project. I am happy to use this for all the future projects.
But right now, i am not getting how to write test case for the following code.
server.seneca.add({role : 'someRole', cmd : 'someCommand'}, (message, next) => { // bussiness logic which i need to test });
seneca.test.js
the above test stops at "expect(err).to.not.exist()" even though err occurs or result is received.
So, i am confused whether i am going in wrong direction? Any help would appreciate.
Please Note:- I am not using Labbable server.