diff --git a/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js b/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js index 99603abb4..531b3ac2d 100644 --- a/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js +++ b/packages/node_modules/@node-red/nodes/core/network/31-tcpin.js @@ -137,7 +137,7 @@ module.exports = function(RED) { var parts = buffer.split(node.newline); for (var i = 0; i\nfoo", topic: 'boo' }], { - payload: "ACK:foobar", + payload: "ACK:foobar\n", topic: 'boo' }, done); }); diff --git a/test/nodes/core/parsers/70-JSON_spec.js b/test/nodes/core/parsers/70-JSON_spec.js index 32c5062e8..c3a2216e0 100644 --- a/test/nodes/core/parsers/70-JSON_spec.js +++ b/test/nodes/core/parsers/70-JSON_spec.js @@ -45,7 +45,7 @@ describe('JSON node', function() { msg.payload.employees[0].should.have.property('lastName', 'Smith'); done(); }); - var jsonString = '{"employees":[{"firstName":"John", "lastName":"Smith"}]}'; + var jsonString = ' {"employees":[{"firstName":"John", "lastName":"Smith"}]}\r\n '; jn1.receive({payload:jsonString,topic: "bar"}); }); }); @@ -63,7 +63,7 @@ describe('JSON node', function() { msg.payload.employees[0].should.have.property('lastName', 'Smith'); done(); }); - var jsonString = Buffer.from('{"employees":[{"firstName":"John", "lastName":"Smith"}]}'); + var jsonString = Buffer.from(' {"employees":[{"firstName":"John", "lastName":"Smith"}]}\r\n '); jn1.receive({payload:jsonString,topic: "bar"}); }); }); diff --git a/test/nodes/core/parsers/70-XML_spec.js b/test/nodes/core/parsers/70-XML_spec.js index e8b281855..c5e13f952 100644 --- a/test/nodes/core/parsers/70-XML_spec.js +++ b/test/nodes/core/parsers/70-XML_spec.js @@ -56,7 +56,7 @@ describe('XML node', function() { should.equal(msg.payload.employees.lastName[0], 'Smith'); done(); }); - var string = 'JohnSmith'; + var string = ' JohnSmith\r\n '; n1.receive({payload:string,topic: "bar"}); }); }); @@ -76,7 +76,7 @@ describe('XML node', function() { should.equal(msg.foo.employees.lastName[0], 'Smith'); done(); }); - var string = 'JohnSmith'; + var string = ' JohnSmith\r\n '; n1.receive({foo:string,topic: "bar"}); }); }); @@ -96,7 +96,7 @@ describe('XML node', function() { should.equal(msg.payload.employees.lastName[0], 'Smith'); done(); }); - var string = 'JohnSmith'; + var string = ' JohnSmith\r\n '; n1.receive({payload:string, topic:"bar", options:{trim:true}}); }); });