Is it possible to unit test config nodes in isolation? If so, how do I go about doing it?
I am also interested in this. What I've tried so far was not successful.
- I manually tested that I can create and connect to a remote host with the config node so I know it works.
- I then tried to write a unit test that proves that the config node is loaded by checking that one of it's properties exists.
- The test failed.
it('should be loaded', (done) => {
var flow = [{ id: "n1", type: "qsys-core", host: "127.0.0.1" }];
helper.load(qsysCore, flow, () => {
var n1 = helper.getNode("n1");
try {
n1.should.have.property('host', '127.0.0.1');
done();
} catch (err) {
done(err);
}
});
});
Caveat: There are surely people with more experience with this sort of thing than I on the forum. My failed unit test may be the result of some silly typo or missed declaration that I haven't yet tracked down.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.