12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- const should = require("should");
- const helper = require("node-red-node-test-helper")
- const loggerNode = require("../loggerNode.js");
-
-
-
- helper.init(require.resolve('node-red'), {
- functionGlobalContext: { os:require('os') }
- });
-
- console.log("helper "+Object.keys(helper));
-
- describe('Logger Node', function () {
-
- afterEach(function () {
- helper.unload();
- });
-
- var logEvents = helper.log().args.filter(function(evt) {
- console.log("loags "+evt[0].type)
- return evt[0].type == "batch";
- });
-
- it('should be loaded', function (done) {
- const flow = [{ id: "n1", type: "Logger", name: "test name" ,count: 19}];
- helper.load(loggerNode, flow, function () {
-
-
-
-
- done();
- });
- });
-
- it('should log payload ', function (done) {
- const flow = [
- { id: "n1", type: "helper" },
- { id: "n2", type: "helper" },
- { id: "n3", type: "Logger", name: "test name",wires:[["n1"]] }
- ];
-
- done();
- });
- });
|