let css node handle ip addresses without trying to parse

and only warn once if no template (and then send object anyway)
to close #1142
This commit is contained in:
Dave Conway-Jones
2017-02-07 21:14:12 +00:00
parent 1d15ee7034
commit 50838970ec
2 changed files with 30 additions and 2 deletions

View File

@@ -179,6 +179,21 @@ describe('CSV node', function() {
n1.emit("input", {payload:testString});
});
});
it('should handle numbers in strings but not IP addresses', function(done) {
var flow = [ { id:"n1", type:"csv", temp:"a,b,c,d,e", wires:[["n2"]] },
{id:"n2", type:"helper"} ];
helper.load(csvNode, flow, function() {
var n1 = helper.getNode("n1");
var n2 = helper.getNode("n2");
n2.on("input", function(msg) {
msg.should.have.property('payload', { a: "a", b: "127.0.0.1", c: 56.7, d: -32.8, e: "+76.22C" });
done();
});
var testString = "a,127.0.0.1,56.7,-32.8,+76.22C";
n1.emit("input", {payload:testString});
});
});
});
describe('json object to csv', function() {